public void init(StructObjectInspector structObjectInspector, List<Integer> projectedColumns)
      throws HiveException {
    List<? extends StructField> fields = structObjectInspector.getAllStructFieldRefs();
    final int count = fields.size();
    allocateArrays(count);

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

      int projectionColumnNum = projectedColumns.get(i);

      StructField field = fields.get(i);
      ObjectInspector fieldInspector = field.getFieldObjectInspector();
      TypeInfo typeInfo =
          TypeInfoUtils.getTypeInfoFromTypeString(fieldInspector.getTypeName());
      initEntry(i, projectionColumnNum, typeInfo);
    }
  }
This class extracts specified VectorizedRowBatch row columns into writables.

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