aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorPrashant Sharma <prashant.s@imaginea.com>2013-11-28 13:02:28 +0530
committerPrashant Sharma <prashant.s@imaginea.com>2013-11-28 13:02:28 +0530
commit3ec5d7476690a5f8a011ec3eaa2d9003f9559b12 (patch)
tree3f2564fd25dc61099934e366e4d36eaab3bbcd9c /core
parent17987778daac140027b7a01c0ec22f0b3e4f3b83 (diff)
downloadspark-3ec5d7476690a5f8a011ec3eaa2d9003f9559b12.tar.gz
spark-3ec5d7476690a5f8a011ec3eaa2d9003f9559b12.tar.bz2
spark-3ec5d7476690a5f8a011ec3eaa2d9003f9559b12.zip
Fixed the broken build.
Diffstat (limited to 'core')
-rw-r--r--core/src/main/scala/org/apache/spark/rdd/DoubleRDDFunctions.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/src/main/scala/org/apache/spark/rdd/DoubleRDDFunctions.scala b/core/src/main/scala/org/apache/spark/rdd/DoubleRDDFunctions.scala
index 02d75eccc5..688c310ee9 100644
--- a/core/src/main/scala/org/apache/spark/rdd/DoubleRDDFunctions.scala
+++ b/core/src/main/scala/org/apache/spark/rdd/DoubleRDDFunctions.scala
@@ -90,12 +90,13 @@ class DoubleRDDFunctions(self: RDD[Double]) extends Logging with Serializable {
def histogram(bucketCount: Int): Pair[Array[Double], Array[Long]] = {
// Compute the minimum and the maxium
val (max: Double, min: Double) = self.mapPartitions { items =>
- Iterator(items.foldRight(-1/0.0, Double.NaN)((e: Double, x: Pair[Double, Double]) =>
+ Iterator(items.foldRight(Double.NegativeInfinity,
+ Double.PositiveInfinity)((e: Double, x: Pair[Double, Double]) =>
(x._1.max(e), x._2.min(e))))
}.reduce { (maxmin1, maxmin2) =>
(maxmin1._1.max(maxmin2._1), maxmin1._2.min(maxmin2._2))
}
- if (max.isNaN() || max.isInfinity || min.isInfinity ) {
+ if (min.isNaN || max.isNaN || max.isInfinity || min.isInfinity ) {
throw new UnsupportedOperationException(
"Histogram on either an empty RDD or RDD containing +/-infinity or NaN")
}