Skip to content

Commit

Permalink
remove fix for sum()
Browse files Browse the repository at this point in the history
  • Loading branch information
davies committed Oct 3, 2014
1 parent e108ec1 commit 52c535b
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions python/pyspark/rdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,8 +787,6 @@ def sum(self):
>>> sc.parallelize([1.0, 2.0, 3.0]).sum()
6.0
"""
if not self.getNumPartitions():
return 0 # empty RDD can not been reduced
return self.mapPartitions(lambda x: [sum(x)]).reduce(operator.add)

def count(self):
Expand Down

0 comments on commit 52c535b

Please sign in to comment.