public void init(StructObjectInspector structObjectInspector) throws HiveException {

    final List<? extends StructField> fields = structObjectInspector.getAllStructFieldRefs();
    final int count = fields.size();
    allocateArrays(count);

    for (int i = 0; i < count; i++) {

      final StructField field = fields.get(i);
      final ObjectInspector fieldInspector = field.getFieldObjectInspector();
      final TypeInfo typeInfo =
          TypeInfoUtils.getTypeInfoFromTypeString(fieldInspector.getTypeName());

      initTargetEntry(i, i, typeInfo);
    }
  }
This class assigns specified columns of a row from a Writable row objects.

The caller provides the data types and projection column numbers of a subset of the columns
to assign.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorAssignRow.java