DDIA Lab/ practice / mapreduce 0/12 chapters
All labs
Lab · Chapter 10 · Batch Processing

MapReduce Word Count

Input file (one split per line, up to 4)
reducers (R)2

The framework sends each word to reducer hash(word) mod R, so every occurrence of a word meets at the same reducer.

1 Input splits2 Map3 Shuffle & sort4 Reduce
1 · splits → mappers
mapper 1
the log is the database
mapper 2
the database is a cache of the log
mapper 3
streams and tables are two views of the log
2 · map: emit (word, 1)
3 · shuffle: partition & sort by key
4 · reduce: sum per key