mapredWork gWork = Utilities.getMapRedWork(job);
reducer = gWork.getReducer();
reducer.setMapredWork(gWork);
isTagged = gWork.getNeedsTagging();
try {
tableDesc keyTableDesc = gWork.getKeyDesc();
inputKeyDeserializer = (SerDe)ReflectionUtils.newInstance(keyTableDesc.getDeserializerClass(), null);
inputKeyDeserializer.initialize(null, keyTableDesc.getProperties());
keyObjectInspector = inputKeyDeserializer.getObjectInspector();
for(int tag=0; tag<gWork.getTagToValueDesc().size(); tag++) {
// We should initialize the SerDe with the TypeInfo when available.
tableDesc valueTableDesc = gWork.getTagToValueDesc().get(tag);
inputValueDeserializer[tag] = (SerDe)ReflectionUtils.newInstance(valueTableDesc.getDeserializerClass(), null);
inputValueDeserializer[tag].initialize(null, valueTableDesc.getProperties());
valueObjectInspector[tag] = inputValueDeserializer[tag].getObjectInspector();
ArrayList<ObjectInspector> ois = new ArrayList<ObjectInspector>();
ois.add(keyObjectInspector);
ois.add(valueObjectInspector[tag]);