0

I have a list of data like the following.

BLOKA, S1
BLOKB, I2
BLOKB, S3
BLOKA, I2
BLOKA, I1
BLOKB, I1
BLOKB, S3

As there are two keys, the data will go to two reducers. How can I achieve that reducer receive value in sorted order like below?

BLOK A, [I1, I2, S1]
BLOK B, [I2, I2, S3, S3]
Dino
  • 781
  • 3
  • 14
  • 32
  • This is what is referred to as a "secondary sort". There are multiple prior resources that describe how to achieve this. For example: http://stackoverflow.com/questions/18395998/hadoop-map-reduce-secondary-sorting and http://stackoverflow.com/questions/14728480/what-is-the-use-of-grouping-comparator-in-hadoop-map-reduce . – Chris Nauroth Jan 05 '16 at 20:38
  • Thanks Chris. That solve my problem! – Dino Jan 06 '16 at 16:05

0 Answers0