Repository: spark Updated Branches: refs/heads/master 132bcceeb -> 1dd0f1744
[SPARK-25036][SQL][FOLLOW-UP] Avoid match may not be exhaustive in Scala-2.12. ## What changes were proposed in this pull request? This is a follow-up pr of #22014 and #22039 We still have some more compilation errors in mllib with scala-2.12 with sbt: ``` [error] [warn] /home/ishizaki/Spark/PR/scala212/spark/mllib/src/main/scala/org/apache/spark/ml/evaluation/ClusteringEvaluator.scala:116: match may not be exhaustive. [error] It would fail on the following inputs: ("silhouette", _), (_, "cosine"), (_, "squaredEuclidean"), (_, String()), (_, _) [error] [warn] ($(metricName), $(distanceMeasure)) match { [error] [warn] ``` ## How was this patch tested? Existing UTs Closes #22058 from kiszk/SPARK-25036c. Authored-by: Kazuaki Ishizaki <ishiz...@jp.ibm.com> Signed-off-by: Sean Owen <sro...@gmail.com> Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/1dd0f174 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/1dd0f174 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/1dd0f174 Branch: refs/heads/master Commit: 1dd0f1744651efadaa349b96cfd3aaafda1e9f57 Parents: 132bcce Author: Kazuaki Ishizaki <ishiz...@jp.ibm.com> Authored: Fri Aug 10 07:34:09 2018 -0500 Committer: Sean Owen <sro...@gmail.com> Committed: Fri Aug 10 07:34:09 2018 -0500 ---------------------------------------------------------------------- .../scala/org/apache/spark/ml/evaluation/ClusteringEvaluator.scala | 2 ++ 1 file changed, 2 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/1dd0f174/mllib/src/main/scala/org/apache/spark/ml/evaluation/ClusteringEvaluator.scala ---------------------------------------------------------------------- diff --git a/mllib/src/main/scala/org/apache/spark/ml/evaluation/ClusteringEvaluator.scala b/mllib/src/main/scala/org/apache/spark/ml/evaluation/ClusteringEvaluator.scala index a6d6b4e..5c1d1ae 100644 --- a/mllib/src/main/scala/org/apache/spark/ml/evaluation/ClusteringEvaluator.scala +++ b/mllib/src/main/scala/org/apache/spark/ml/evaluation/ClusteringEvaluator.scala @@ -119,6 +119,8 @@ class ClusteringEvaluator @Since("2.3.0") (@Since("2.3.0") override val uid: Str df, $(predictionCol), $(featuresCol)) case ("silhouette", "cosine") => CosineSilhouette.computeSilhouetteScore(df, $(predictionCol), $(featuresCol)) + case (mn, dm) => + throw new IllegalArgumentException(s"No support for metric $mn, distance $dm") } } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org