How to sort data in map reduce hadoop? How to sort data in map reduce hadoop? hadoop hadoop

How to sort data in map reduce hadoop?


If you want to sort according to value's, make it key in map function. i.e.

id      value1        202         33         94        365         3

(value) (key) in map function

output will be key      value3         53         29         320        136        4map<value, id> output key/value  reduce <value, id>

if you want id to be in the first column, this will work.

context.write(value, key);

Note that, id's are not going to be sorted