private InspectableObject[] constructHashAggrInputData(int rowNum, int rowNumWithSameKeys) {
    InspectableObject[] r;
    r = new InspectableObject[rowNum];
    ArrayList<String> names = new ArrayList<String>(3);
    names.add("col0");
    names.add("col1");
    names.add("col2");
    ArrayList<ObjectInspector> objectInspectors = new ArrayList<ObjectInspector>(3);
    objectInspectors.add(PrimitiveObjectInspectorFactory.javaStringObjectInspector);
    objectInspectors.add(PrimitiveObjectInspectorFactory.javaStringObjectInspector);
    objectInspectors.add(PrimitiveObjectInspectorFactory.javaStringObjectInspector);
    // 3 rows with the same col1, col2
    for (int i = 0; i < rowNum; i++) {
      ArrayList<String> data = new ArrayList<String>();
      data.add("" + i);
      data.add("" + (i < rowNumWithSameKeys ? -1 : i));
      data.add("" + (i < rowNumWithSameKeys ? -1 : i));
      try {
        r[i] = new InspectableObject();
        r[i].o = data;
        r[i].oi = ObjectInspectorFactory.getStandardStructObjectInspector(names, objectInspectors);
      } catch (Throwable e) {
        throw new RuntimeException(e);
      }
    }
    return r;
  }
A custom input format that checks to make sure that the fetch operator
sets the required attributes.
ql/src/test/org/apache/hadoop/hive/ql/exec/TestOperators.java