public void init(int[] outputColumns, boolean[] columnsToInclude) throws HiveException {

    Preconditions.checkState(
        outputColumns.length == columnsToInclude.length);

    final int columnCount = sourceTypeInfos.length;
    allocateArrays(columnCount);

    int includedCount = 0;
    final int[] includedIndices = new int[columnCount];

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

      if (!columnsToInclude[i]) {

        // Field not included in query.

      } else {

        initTopLevelField(i, outputColumns[i], sourceTypeInfos[i]);
        includedIndices[includedCount++] = i;
      }
    }

    // Optimizing for readField?
    if (includedCount < columnCount && deserializeRead.isReadFieldSupported()) {
      useReadField = true;
      readFieldLogicalIndices = Arrays.copyOf(includedIndices, includedCount);
    }

  }
@param deserializeRead   Set useExternalBuffer to true to avoid buffer copying and to get
    more efficient reading.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorDeserializeRow.java