How to re-arrange wordcount hadoop output result and sort them by value
问题 I use this code below to get output result like ( Key , Value ) Apple 12 Bee 345 Cat 123 What I want is descending sorted by value ( 345 ) and place them before the key ( Value , Key ) 345 Bee 123 Cat 12 Apple I found there are something called "secondary sorted" not going to lie but I'm so lost - I tried to change .. context.write(key, result); but failed miserably. I'm new to Hadoop and not sure how can I start to tackle this problem. Any recommendation would be appreciated. Which function