Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
1.2.0
-
None
-
Patch
Description
Sum on an empty RDD throws an exception. Expected result is 0.
A simple fix is the replace
class DoubleRDDFunctions { def sum(): Double = self.reduce(_ + _)
with:
class DoubleRDDFunctions { def sum(): Double = self.aggregate(0.0)(_ + _, _ + _)
Attachments
Issue Links
- is related to
-
SPARK-8373 When an RDD has no partition, Python sum will throw "Can not reduce() empty RDD"
- Closed
- links to