Skip to content

Commit

Permalink
added count operation but this implementation need double check
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Takagiwa authored and giwa committed Sep 20, 2014
1 parent 58591d2 commit 98c2a00
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/pyspark/streaming/dstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ def combineByKey(self, createCombiner, mergeValue, mergeCombiners,
def combineLocally(iterator):
combiners = {}
for x in iterator:

#TODO for count operation make sure count implementation
# This is different from what pyspark does
if isinstance(x, int):
x = ("", x)

(k, v) = x
if k not in combiners:
combiners[k] = createCombiner(v)
Expand Down

0 comments on commit 98c2a00

Please sign in to comment.