public static StandardStructObjectInspector constructVectorizedReduceRowOI(
      StructObjectInspector keyInspector, StructObjectInspector valueInspector)
          throws HiveException {

    ArrayList<String> colNames = new ArrayList<String>();
    ArrayList<ObjectInspector> ois = new ArrayList<ObjectInspector>();
    List<? extends StructField> fields = keyInspector.getAllStructFieldRefs();
    for (StructField field: fields) {
      colNames.add(Utilities.ReduceField.KEY.toString() + '.' + field.getFieldName());
      ois.add(field.getFieldObjectInspector());
    }
    fields = valueInspector.getAllStructFieldRefs();
    for (StructField field: fields) {
      colNames.add(Utilities.ReduceField.VALUE.toString() + '.' + field.getFieldName());
      ois.add(field.getFieldObjectInspector());
    }
    StandardStructObjectInspector rowObjectInspector = ObjectInspectorFactory.getStandardStructObjectInspector(colNames, ois);

    return rowObjectInspector;
  }
Create row key and value object inspectors for reduce vectorization.
The row object inspector used by ReduceWork needs to be a **standard**
struct object inspector, not just any struct object inspector.
@param keyInspector
@param valueInspector
@return OI
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java