Database Reference
In-Depth Information
Understanding the reduce phase
The reduce function reads the intermediate <key, value> pairs emitted by the map-
per and produces the final result.
These results are then taken as input by the reducer in a sorted order of the keys. The redu-
cer logic would then work on each key group; in this case, it would sum up the values for
each key and would produce the final result as follows:
she, 2
sells,2
sea, 2
shells, 1
on, 1
the, 1
shore, 1
where, 1
also, 1
cookies, 1
The following is a functional representation of the map and reduce functions:
Function
Input
Output
<k1, v1>
list(k2, v2)
map
reduce <k2, list(v2)> list(<k3, v3>)
The following diagram shows the flow of a MapReduce job starting from an input file right
up to the generation of an output file:
Search WWH ::




Custom Search