What is the use of grouping comparator in hadoop map reduce
I would like to know why grouping comparator is used in secondary sort of mapreduce. According to the definitive guide example of secondary sorting We want the sort order for keys to be by year (ascending) and then by temperature (descending): 1900 35°C 1900 34°C 1900 34°C ... 1901 36°C 1901 35°C By setting a partitioner to partition by the year part of the key, we can guarantee that records for the same year go to the same reducer. This still isn’t enough to achieve our goal, however. A partitioner ensures only that one reducer receives all the records for a year; it doesn’t change the fact