Skip to content

Commit 3ebb710

Browse files
ueshinRobert Kruszewski
authored andcommitted
[SPARK-21898][ML][FOLLOWUP] Fix Scala 2.12 build.
## What changes were proposed in this pull request? This is a follow-up pr of apache#19108 which broke Scala 2.12 build. ``` [error] /Users/ueshin/workspace/apache-spark/spark/mllib/src/main/scala/org/apache/spark/ml/stat/KolmogorovSmirnovTest.scala:86: overloaded method value test with alternatives: [error] (dataset: org.apache.spark.sql.DataFrame,sampleCol: String,cdf: org.apache.spark.api.java.function.Function[java.lang.Double,java.lang.Double])org.apache.spark.sql.DataFrame <and> [error] (dataset: org.apache.spark.sql.DataFrame,sampleCol: String,cdf: scala.Double => scala.Double)org.apache.spark.sql.DataFrame [error] cannot be applied to (org.apache.spark.sql.DataFrame, String, scala.Double => java.lang.Double) [error] test(dataset, sampleCol, (x: Double) => cdf.call(x)) [error] ^ [error] one error found ``` ## How was this patch tested? Existing tests. Author: Takuya UESHIN <[email protected]> Closes apache#20994 from ueshin/issues/SPARK-21898/fix_scala-2.12.
1 parent 5997700 commit 3ebb710

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mllib/src/main/scala/org/apache/spark/ml/stat/KolmogorovSmirnovTest.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ object KolmogorovSmirnovTest {
8383
@Since("2.4.0")
8484
def test(dataset: DataFrame, sampleCol: String,
8585
cdf: Function[java.lang.Double, java.lang.Double]): DataFrame = {
86-
test(dataset, sampleCol, (x: Double) => cdf.call(x))
86+
val f: Double => Double = x => cdf.call(x)
87+
test(dataset, sampleCol, f)
8788
}
8889

8990
/**

0 commit comments

Comments
 (0)