File tree Expand file tree Collapse file tree 2 files changed +2
-17
lines changed
src/main/java/com/marklogic/spark/reader Expand file tree Collapse file tree 2 files changed +2
-17
lines changed Original file line number Diff line number Diff line change @@ -57,13 +57,6 @@ dependencies {
57
57
// Need this so that an OkHttpClientConfigurator can be created.
58
58
shadowDependencies ' com.squareup.okhttp3:okhttp:4.12.0'
59
59
60
- // Makes it possible to use lambdas in Java 8 to implement Spark's Function1 and Function2 interfaces
61
- // See https://github.com/scala/scala-java8-compat for more information
62
- shadowDependencies(" org.scala-lang.modules:scala-java8-compat_2.12:1.0.2" ) {
63
- // Prefer the Scala libraries used within the user's Spark runtime.
64
- exclude module : " scala-library"
65
- }
66
-
67
60
shadowDependencies (" org.apache.jena:jena-arq:4.10.0" ) {
68
61
exclude group : " com.fasterxml.jackson.core"
69
62
exclude group : " com.fasterxml.jackson.dataformat"
Original file line number Diff line number Diff line change 13
13
import scala .Function2 ;
14
14
import scala .collection .JavaConverters ;
15
15
import scala .collection .Seq ;
16
- import scala .compat .java8 .JFunction ;
17
16
18
17
import java .util .ArrayList ;
19
18
@@ -33,17 +32,10 @@ public class JsonRowDeserializer {
33
32
private final Function2 <JsonFactory , String , JsonParser > jsonParserCreator ;
34
33
private final Function1 <String , UTF8String > utf8StringCreator ;
35
34
36
- // Ignoring warnings about JFunction.func until an alternative can be found.
37
- @ SuppressWarnings ("java:S1874" )
38
35
public JsonRowDeserializer (StructType schema ) {
39
36
this .jacksonParser = newJacksonParser (schema );
40
-
41
- // Used https://github.com/scala/scala-java8-compat in the DHF Spark 2 connector. Per the README for
42
- // scala-java8-compat, we should be able to use scala.jdk.FunctionConverters since those are part of Scala
43
- // 2.13. However, that is not yet working within PySpark. So sticking with this "legacy" approach as it seems
44
- // to work fine in both vanilla Spark (i.e. JUnit tests) and PySpark.
45
- this .jsonParserCreator = JFunction .func (CreateJacksonParser ::string );
46
- this .utf8StringCreator = JFunction .func (UTF8String ::fromString );
37
+ this .jsonParserCreator = CreateJacksonParser ::string ;
38
+ this .utf8StringCreator = UTF8String ::fromString ;
47
39
}
48
40
49
41
public InternalRow deserializeJson (String json ) {
You can’t perform that action at this time.
0 commit comments