You need a second MapReduce job. Take your WordCount input, have the mapper 
swapping keys and values, i.e. map(word, count) => (count, word), then your 
reducer will get the records sorted by count. Since you won’t have too many 
unique words, one reducer should be fine, and  you don’t have to worry about a 
more complex partitioner.

Kai

Am 17.08.2014 um 04:35 schrieb [email protected]:

> Hello,
> I am using mapreduce to get the frequency of words in a corpus . 
> And I want to get a descnding sorted result.
> Now  I can use Hive to sort them ,but If i use mapreduce,how can i do this ?
> 
> Thakns.
> 
> [email protected]

Kai Voigt                       Am Germaniahafen 1                      
[email protected]
                                        24143 Kiel                              
        +49 160 96683050
                                        Germany                                 
        @KaiVoigt

Reply via email to