mirror of
https://github.com/donnemartin/system-design-primer.git
synced 2025-12-15 17:38:56 +03:00
pastebin example: fix pseudo code bug
This should make it clear that the code the developer writes for the reduce steps indeed gets an iterable of values, not only a single value.
This commit is contained in:
@@ -218,7 +218,7 @@ class HitCounts(MRJob):
|
|||||||
period = self.extract_year_month(line)
|
period = self.extract_year_month(line)
|
||||||
yield (period, url), 1
|
yield (period, url), 1
|
||||||
|
|
||||||
def reducer(self, key, value):
|
def reducer(self, key, values):
|
||||||
"""Sum values for each key.
|
"""Sum values for each key.
|
||||||
|
|
||||||
(2016-01, url0), 2
|
(2016-01, url0), 2
|
||||||
|
|||||||
Reference in New Issue
Block a user