vendredi 29 mai 2015

MapReduce output key in ascending order

I have a written a MapReduce code for which both keys and values are integers. The output is like this:

   Key    Value
1      78
128    12
174    26
2      44
2957   123
975    91

Is there a way that the output will be sorted by key in ascending order? such that the output looks like this:

1      78
2      44
128    12
174    26
975    91
2957   123

Do I need to use conf.setComparator ? If yes, how can I do that?

Aucun commentaire:

Enregistrer un commentaire