Created on 11-06-2014 10:09 PM - edited 09-16-2022 02:12 AM
Hi,
Can you help me on this ? I want to write map reduce program which will display a word which repeated highest time in file.
Any way to modify wordcount mapreduce program to display only single row as word, # of count
Thanks
Sach
Created 11-30-2014 05:07 AM
Created 11-08-2014 06:09 AM
it seems you still don't know the main concept of map and reduce. basically, your question is very easy.
maybe you know, every output from map will be sorted by word automatically, so as the original output of course is not suit to you.
for example you have these original words like below:
"i love love love you and love love you"
then the output after map will be like this:
and 1
i 1
love 5
you 2
so after you get these words input in Reduce, you just save the number, and compare them, after you get the max, then output.
Created 02-22-2021 06:46 AM
that output comes after the reduce function not map
Created 11-30-2014 05:07 AM