On Feb 6, 2008, at 2:52 PM, Joydeep Sen Sarma wrote:

ok - got it. This seems to be a subtle drawback in the reduce api. Keys
in the same reduce group may differ - but the reduce api does not make
it possible for the reducer function to get access to each key. It only
gets access to the starting key value for that group.

With a context object api, it would be:

public interface Reducer<KeyIn,ValueIn,KeyOut,ValueOut> extends Closeable {
  void reduce(ReducerContext<KeyIn,ValueIn,KeyOut,ValueOut> context
              ) throws IOException, InterruptedException;
}

and the ReducerContext would have:

KeyIn getKey();

to get the key. Then your assumption would work because it would be the current key. Now if only I had time to work on HADOOP-1230. *smile*

-- Owen

Reply via email to