Skip to content

Commit

Permalink
[SPARK-25036][SQL][FOLLOW-UP] Avoid match may not be exhaustive in Sc…
Browse files Browse the repository at this point in the history
…ala-2.12.

## What changes were proposed in this pull request?

This is a follow-up pr of apache#22014 and apache#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 apache#22058 from kiszk/SPARK-25036c.

Authored-by: Kazuaki Ishizaki <[email protected]>
Signed-off-by: Sean Owen <[email protected]>
  • Loading branch information
kiszk authored and srowen committed Aug 10, 2018
1 parent 132bcce commit 1dd0f17
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
}
Expand Down

0 comments on commit 1dd0f17

Please sign in to comment.