Skip to content
Snippets Groups Projects
Commit 7222ee29 authored by Holden Karau's avatar Holden Karau
Browse files

Fix the test

parent e163e31c
No related branches found
No related tags found
No related merge requests found
......@@ -191,8 +191,8 @@ class JavaDoubleRDD(val srdd: RDD[scala.Double]) extends JavaRDDLike[Double, Jav
* the maximum value of the last position and all NaN entries will be counted
* in that bucket.
*/
def histogram(buckets: Array[Double]): Array[Long] = {
srdd.histogram(buckets.map(_.toDouble), false)
def histogram(buckets: Array[scala.Double]): Array[Long] = {
srdd.histogram(buckets, false)
}
def histogram(buckets: Array[Double], evenBuckets: Boolean): Array[Long] = {
......
......@@ -368,10 +368,10 @@ public class JavaAPISuite implements Serializable {
public void javaDoubleRDDHistoGram() {
JavaDoubleRDD rdd = sc.parallelizeDoubles(Arrays.asList(1.0, 2.0, 3.0, 4.0));
// Test using generated buckets
Tuple2<Double[], long[]> results = rdd.histogram(2);
Double[] expected_buckets = {1.0, 2.5, 4.0};
Tuple2<double[], long[]> results = rdd.histogram(2);
double[] expected_buckets = {1.0, 2.5, 4.0};
long[] expected_counts = {2, 2};
Assert.assertArrayEquals(expected_buckets, results._1);
Assert.assertArrayEquals(expected_buckets, results._1, 0.1);
Assert.assertArrayEquals(expected_counts, results._2);
// Test with provided buckets
long[] histogram = rdd.histogram(expected_buckets);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment