public void map(ImmutableBytesWritable key, Result value,
    OutputCollector<ImmutableBytesWritable, Result> output, Reporter reporter) throws IOException {

    byte[][] keyVals = extractKeyValues(value);
    if (keyVals != null) {
      ImmutableBytesWritable tKey = createGroupKey(keyVals);
      output.collect(tKey, value);
    }
  }
Extract the grouping columns from value to construct a new key. Pass the new key and value to
reduce. If any of the grouping columns are not found in the value, the record is skipped.
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapred/GroupingTableMap.java