Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
MapReduce >> mail # user >> Re: GroupingComparator


Copy link to this message
-
Re: GroupingComparator
On Oct 15, 2012, at 12:27 PM, Dave Beech wrote:

> This only happens in the new "mapreduce" API - in the older "mapred"
> API you get the first key, and it appears to stay the same during the
> loop.
>
> It's sometimes useful behaviour, but it's confusing how the two APIs
> don't act the same.
Yes, it is a bit counter intuitive. In the older API, there is no way to find out the current key corresponding to the current value in case there is a grouping-comparator/secondary sort. The newer API gives you this facility and that naturally changes the behavior of the key.

FWIW, we can document this as part of the Reducer class' javadoc.

Thanks,
+Vinod