Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to sort word count by value in hadoop? [duplicate]

hi i wanted to learn how to sort the word count by value in hadoop.i know hadoop takes of sorting keys, but not by values.

i know to sort the values we must have a partitioner,groupingcomparator and a sortcomparator

but i am bit confused in applying these concepts together to sort the word count by value.

do we need another map reduce job to achieve the same or else a combiner to count the occurrences and then sort here and emit the same to reducer?

can any one explain how to sort word count example by values?

like image 616
user1585111 Avatar asked Aug 23 '13 13:08

user1585111


1 Answers

You need to have a second mapreduce job. Unless you conclude on the the totals counts (which the first MR job does) how can you think of sorting by value (the counts of the words)? Logically not possible.

like image 81
Rags Avatar answered Sep 29 '22 11:09

Rags