Skip to content

Commit

Permalink
Style fixes from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
holdenk committed Mar 14, 2014
1 parent 96b047b commit 70b4724
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/pyspark/rdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,8 @@ def aggregate(self, zeroValue, seqOp, combOp):
the type of this RDD. Thus, we need one operation for merging a T into an U
and one operation for merging two U
>>> seqOp = (lambda x, y: (x[0]+y, x[1] + 1))
>>> combOp = (lambda x, y: (x[0]+y[0], x[1] + y[1]))
>>> seqOp = (lambda x, y: (x[0] + y, x[1] + 1))
>>> combOp = (lambda x, y: (x[0] + y[0], x[1] + y[1]))
>>> sc.parallelize([1, 2, 3, 4]).aggregate((0, 0), seqOp, combOp)
(10, 4)
"""
Expand All @@ -592,6 +592,7 @@ def func(iterator):
if acc is not None:
yield acc
return self.mapPartitions(func).reduce(combOp)

def sum(self):
"""
Add up the elements in this RDD.
Expand Down

0 comments on commit 70b4724

Please sign in to comment.