Reduce() method
The following are characteristics of the Reduce function, including examples of the input and output and the action the reduce method performs.
- Input: Word and a list of counts of occurrences of this word
- Output: A (word, total count of occurrences) pair
- Action: Sums all counts for a particular word
Input data
WORD | TOTAL_COUNT
--------+------------
Hello | (1,1,1)
World | (1,1)
Goodbye | (1)
INZA | (1)
map | (1)
reduce | (1)
Bye | (1)
Output data
WORD | COUNT
---------+-------
INZA | 1
World | 2
Bye | 1
Goodbye | 1
map | 1
Hello | 3
reduce | 1