开发者

Hadoop WordCount example - Implementing Sorting

开发者 https://www.devze.com 2023-01-20 19:25 出处:网络
I\'ma Hadoop newbie. I have been able to successfully run the WordCount example. I would like to modify this example such that my output is sorted in ascending order of count. I\'m unable to figure

I'm a Hadoop newbie. I have been able to successfully run the WordCount example.

I would like to modify this example such that my output is sorted in ascending order of count. I'm unable to figure out where I would need to make the necessary changes.

It would be great if someone would give me some direction to impleme开发者_运维百科nt sorting?


See org.apache.hadoop.examples.Sort

This is not super-straightforward to do using map/reduce. It involves taking a histogram of your data and using the TotalOrderPartitioner.

Alternatively, you can use Hive or Pig, which has built-in functions for sorting.

0

精彩评论

暂无评论...
验证码 换一张
取 消