public static ObjectInspector getStandardObjectInspector(ObjectInspector oi,
      ObjectInspectorCopyOption objectInspectorOption) {
    ObjectInspector result = null;
    switch (oi.getCategory()) {
    case PRIMITIVE: {
      PrimitiveObjectInspector poi = (PrimitiveObjectInspector) oi;
      switch (objectInspectorOption) {
      case DEFAULT: {
        if (poi.preferWritable()) {
          result = PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(
              poi.getTypeInfo());
        } else {
          result = PrimitiveObjectInspectorFactory.getPrimitiveJavaObjectInspector(
              poi.getTypeInfo());
        }
        break;
      }
      case JAVA: {
        result = PrimitiveObjectInspectorFactory.getPrimitiveJavaObjectInspector(
            poi.getTypeInfo());
        break;
      }
      case WRITABLE:
        result = PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(
            poi.getTypeInfo());
        break;
      }
      break;
    }
    case LIST: {
      ListObjectInspector loi = (ListObjectInspector) oi;
      result = ObjectInspectorFactory
          .getStandardListObjectInspector(getStandardObjectInspector(loi
          .getListElementObjectInspector(), objectInspectorOption));
      break;
    }
    case MAP: {
      MapObjectInspector moi = (MapObjectInspector) oi;
      result = ObjectInspectorFactory.getStandardMapObjectInspector(
          getStandardObjectInspector(moi.getMapKeyObjectInspector(),
          objectInspectorOption), getStandardObjectInspector(moi
          .getMapValueObjectInspector(), objectInspectorOption));
      break;
    }
    case STRUCT: {
      StructObjectInspector soi = (StructObjectInspector) oi;
      List<? extends StructField> fields = soi.getAllStructFieldRefs();
      List<String> fieldNames = new ArrayList<String>(fields.size());
      List<ObjectInspector> fieldObjectInspectors = new ArrayList<ObjectInspector>(
          fields.size());
      for (StructField f : fields) {
        fieldNames.add(f.getFieldName());
        fieldObjectInspectors.add(getStandardObjectInspector(f
            .getFieldObjectInspector(), objectInspectorOption));
      }
      result = ObjectInspectorFactory.getStandardStructObjectInspector(
          fieldNames, fieldObjectInspectors);
      break;
    }
    case UNION: {
      UnionObjectInspector uoi = (UnionObjectInspector) oi;
      List<ObjectInspector> ois = new ArrayList<ObjectInspector>();
      for (ObjectInspector eoi : uoi.getObjectInspectors()) {
        ois.add(getStandardObjectInspector(eoi, objectInspectorOption));
      }
      result = ObjectInspectorFactory.getStandardUnionObjectInspector(ois);
      break;
    }
    default: {
      throw new RuntimeException("Unknown ObjectInspector category!");
    }
    }
    return result;
  }
Get the corresponding standard ObjectInspector for an ObjectInspector.

The returned ObjectInspector can be used to inspect the standard object.
serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorUtils.java