diff options
author | Joseph K. Bradley <joseph@databricks.com> | 2016-04-12 03:24:26 +0100 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2016-04-12 03:24:26 +0100 |
commit | e9e1adc036643c6b126237903b8e79ab379b1d32 (patch) | |
tree | 1f39bf9c055f60e6cb385b95171b6a188ae2abbc | |
parent | 26d7af9119a73d851c86314b4a207c0bfe437082 (diff) | |
download | spark-e9e1adc036643c6b126237903b8e79ab379b1d32.tar.gz spark-e9e1adc036643c6b126237903b8e79ab379b1d32.tar.bz2 spark-e9e1adc036643c6b126237903b8e79ab379b1d32.zip |
[MINOR][ML] Fixed MLlib build warnings
## What changes were proposed in this pull request?
Fixes to eliminate warnings during package and doc builds.
## How was this patch tested?
Existing unit tests
Author: Joseph K. Bradley <joseph@databricks.com>
Closes #12263 from jkbradley/warning-cleanups.
-rw-r--r-- | examples/src/main/java/org/apache/spark/examples/mllib/JavaStratifiedSamplingExample.java | 1 | ||||
-rw-r--r-- | mllib/src/test/scala/org/apache/spark/ml/tree/impl/RandomForestSuite.scala | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/examples/src/main/java/org/apache/spark/examples/mllib/JavaStratifiedSamplingExample.java b/examples/src/main/java/org/apache/spark/examples/mllib/JavaStratifiedSamplingExample.java index 86c389e11c..72bbb2a8fa 100644 --- a/examples/src/main/java/org/apache/spark/examples/mllib/JavaStratifiedSamplingExample.java +++ b/examples/src/main/java/org/apache/spark/examples/mllib/JavaStratifiedSamplingExample.java @@ -35,6 +35,7 @@ public class JavaStratifiedSamplingExample { SparkConf conf = new SparkConf().setAppName("JavaStratifiedSamplingExample"); JavaSparkContext jsc = new JavaSparkContext(conf); + @SuppressWarnings("unchecked") // $example on$ List<Tuple2<Integer, Character>> list = new ArrayList<>( Arrays.<Tuple2<Integer, Character>>asList( diff --git a/mllib/src/test/scala/org/apache/spark/ml/tree/impl/RandomForestSuite.scala b/mllib/src/test/scala/org/apache/spark/ml/tree/impl/RandomForestSuite.scala index e64551f03c..cd402b1e1f 100644 --- a/mllib/src/test/scala/org/apache/spark/ml/tree/impl/RandomForestSuite.scala +++ b/mllib/src/test/scala/org/apache/spark/ml/tree/impl/RandomForestSuite.scala @@ -327,7 +327,9 @@ class RandomForestSuite extends SparkFunSuite with MLlibTestSparkContext { case n: InternalNode => n.split match { case s: CategoricalSplit => assert(s.leftCategories === Array(1.0)) + case _ => throw new AssertionError("model.rootNode.split was not a CategoricalSplit") } + case _ => throw new AssertionError("model.rootNode was not an InternalNode") } } @@ -352,6 +354,7 @@ class RandomForestSuite extends SparkFunSuite with MLlibTestSparkContext { assert(n.leftChild.isInstanceOf[InternalNode]) assert(n.rightChild.isInstanceOf[InternalNode]) Array(n.leftChild.asInstanceOf[InternalNode], n.rightChild.asInstanceOf[InternalNode]) + case _ => throw new AssertionError("rootNode was not an InternalNode") } // Single group second level tree construction. |