private Object setValueInternal(final Object struct, ColumnVector colVector, int batchIndex) {
        if (colVector == null) {
          // The planner will not include unneeded columns for reading but other parts of execution
          // may ask for them..
          return null;
        }

        final int adjustedIndex = (colVector.isRepeating ? 0 : batchIndex);
        if (!colVector.noNulls && colVector.isNull[adjustedIndex]) {
          return null;
        }

        final StructColumnVector structColumnVector = (StructColumnVector) colVector;
        final StandardStructObjectInspector structInspector =
            (StandardStructObjectInspector) objectInspector;
        final List<TypeInfo> fieldTypeInfos = structTypeInfo.getAllStructFieldTypeInfos();
        final int size = fieldTypeInfos.size();
        final List<? extends StructField> structFields =
            structInspector.getAllStructFieldRefs();

        for (int i = 0; i < size; i++) {
          final StructField structField = structFields.get(i);
          final TypeInfo fieldTypeInfo = fieldTypeInfos.get(i);
          final Object value = vectorExtractRow.extractRowColumn(
              structColumnVector.fields[i],
              fieldTypeInfo,
              structField.getFieldObjectInspector(),
              adjustedIndex);
          structInspector.setStructFieldData(struct, structField, value);
        }
        return struct;
      }
Compiles the appropriate vector expression writers based on a struct object
inspector.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/VectorExpressionWriterFactory.java