Repository: spark
Updated Branches:
  refs/heads/master e99825058 -> 6ab134ca7


[SPARK-21898][ML][FOLLOWUP] Fix Scala 2.12 build.

## What changes were proposed in this pull request?

This is a follow-up pr of #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 <ues...@databricks.com>

Closes #20994 from ueshin/issues/SPARK-21898/fix_scala-2.12.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/6ab134ca
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/6ab134ca
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/6ab134ca

Branch: refs/heads/master
Commit: 6ab134ca7d8f7802a6d196929513cc02b9b4d35d
Parents: e998250
Author: Takuya UESHIN <ues...@databricks.com>
Authored: Fri Apr 6 15:00:13 2018 -0700
Committer: Takuya UESHIN <ues...@databricks.com>
Committed: Fri Apr 6 15:00:13 2018 -0700

----------------------------------------------------------------------
 .../scala/org/apache/spark/ml/stat/KolmogorovSmirnovTest.scala    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/6ab134ca/mllib/src/main/scala/org/apache/spark/ml/stat/KolmogorovSmirnovTest.scala
----------------------------------------------------------------------
diff --git 
a/mllib/src/main/scala/org/apache/spark/ml/stat/KolmogorovSmirnovTest.scala 
b/mllib/src/main/scala/org/apache/spark/ml/stat/KolmogorovSmirnovTest.scala
index 8d80e77..c62d746 100644
--- a/mllib/src/main/scala/org/apache/spark/ml/stat/KolmogorovSmirnovTest.scala
+++ b/mllib/src/main/scala/org/apache/spark/ml/stat/KolmogorovSmirnovTest.scala
@@ -83,7 +83,8 @@ object KolmogorovSmirnovTest {
   @Since("2.4.0")
   def test(dataset: DataFrame, sampleCol: String,
     cdf: Function[java.lang.Double, java.lang.Double]): DataFrame = {
-    test(dataset, sampleCol, (x: Double) => cdf.call(x))
+    val f: Double => Double = x => cdf.call(x)
+    test(dataset, sampleCol, f)
   }
 
   /**


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to