public static ArrayList<TypeInfo> typeInfosFromStructObjectInspector(
      StructObjectInspector structObjectInspector) {

    List<? extends StructField> fields = structObjectInspector.getAllStructFieldRefs();
    ArrayList<TypeInfo> typeInfoList = new ArrayList<TypeInfo>(fields.size());

    for(StructField field : fields) {
      TypeInfo typeInfo = TypeInfoUtils.getTypeInfoFromTypeString(
          field.getFieldObjectInspector().getTypeName());
      typeInfoList.add(typeInfo);
    }
    return typeInfoList;
  }
Get the TypeInfo object from the ObjectInspector object by recursively
going into the ObjectInspector structure.
serde/src/java/org/apache/hadoop/hive/serde2/typeinfo/TypeInfoUtils.java