13. function map_1(t, search_phrase)
emit(search_phrase, 1)
sort and shuffle
function reduce_1(search_phrase, counts)
total = 0
for count in counts
total += count
emit(search_phrase, total)
function map_2(search_phrase, total)
emit(total, search_phrase)
sort and shuffle
function reduce_2(total, search_phrases)
for search_phrase in search_phrases
emit(search_phrase, total)
Sunday, September 11, 11
14. map shuffle reduce
cat IN | sort | uniq -c > OUT
map shuffle reduce
awk ‘{print $2,$1}’ OUT | sort > FINAL
Sunday, September 11, 11