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

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

Alberto Cordioli 2012-10-15, 20:39
Dave Beech 2012-10-15, 20:49
Alberto Cordioli 2012-10-16, 08:42
Dave Beech 2012-10-16, 09:08
Alberto Cordioli 2012-10-16, 09:45
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.