public void init(int[] inputColumnMap, int[] outputColumnMap, TypeInfo[] typeInfos)
      throws HiveException {

    final int count = inputColumnMap.length;
    subRowToBatchCopiersByValue = new CopyRow[count];
    subRowToBatchCopiersByReference = new CopyRow[count];

    for (int i = 0; i < count; i++) {
      int inputColumn = inputColumnMap[i];
      int outputColumn = outputColumnMap[i];
      TypeInfo typeInfo = typeInfos[i];
      Type columnVectorType = VectorizationContext.getColumnVectorTypeFromTypeInfo(typeInfo);

      CopyRow copyRowByValue = null;
      CopyRow copyRowByReference = null;

      switch (columnVectorType) {
      case LONG:
        copyRowByValue = new LongCopyRow(inputColumn, outputColumn);
        break;

      case TIMESTAMP:
        copyRowByValue = new TimestampCopyRow(inputColumn, outputColumn);
        break;

      case INTERVAL_DAY_TIME:
        copyRowByValue = new IntervalDayTimeCopyRow(inputColumn, outputColumn);
        break;

      case DOUBLE:
        copyRowByValue = new DoubleCopyRow(inputColumn, outputColumn);
        break;

      case BYTES:
        copyRowByValue = new BytesCopyRowByValue(inputColumn, outputColumn);
        copyRowByReference = new BytesCopyRowByReference(inputColumn, outputColumn);
        break;

      case DECIMAL:
        copyRowByValue = new DecimalCopyRow(inputColumn, outputColumn);
        break;

      default:
        throw new HiveException("Unexpected column vector type " + columnVectorType);
      }

      subRowToBatchCopiersByValue[i] = copyRowByValue;
      if (copyRowByReference == null) {
        subRowToBatchCopiersByReference[i] = copyRowByValue;
      } else {
        subRowToBatchCopiersByReference[i] = copyRowByReference;
      }
    }
  }
This class copies specified columns of a row from one VectorizedRowBatch to another.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorCopyRow.java