private static ObjectInspector createStructFromFields(List<StructField> fields, String prefixToRemove) {
    int prefixLength = prefixToRemove.length() + 1; // also remove the '.' after the prefix
    ArrayList<String> fieldNames = new ArrayList<String>();
    ArrayList<ObjectInspector> fieldOIs = new ArrayList<ObjectInspector>();
    for (StructField field : fields) {
      fieldNames.add(field.getFieldName().substring(prefixLength));
      fieldOIs.add(field.getFieldObjectInspector());
    }
    return ObjectInspectorFactory.getStandardStructObjectInspector(fieldNames, fieldOIs);
  }
Create a new struct object inspector for the list of struct fields, first removing the
prefix from the field name.
@param fields
@param prefixToRemove
@return
ql/src/java/org/apache/hadoop/hive/ql/exec/JoinUtil.java