public static void copyRepeatingColumn(VectorizedRowBatch sourceBatch, int sourceColumnNum,
      VectorizedRowBatch targetBatch, int targetColumnNum, boolean setByValue) {
    ColumnVector sourceColVector = sourceBatch.cols[sourceColumnNum];
    ColumnVector targetColVector = targetBatch.cols[targetColumnNum];

    targetColVector.isRepeating = true;

    if (!sourceColVector.noNulls) {
      targetColVector.noNulls = false;
      targetColVector.isNull[0] = true;
      return;
    }

    switch (sourceColVector.type) {
    case LONG:
      ((LongColumnVector) targetColVector).vector[0] =
          ((LongColumnVector) sourceColVector).vector[0];
      break;
    case DOUBLE:
      ((DoubleColumnVector) targetColVector).vector[0] =
          ((DoubleColumnVector) sourceColVector).vector[0];
      break;
    case BYTES:
      {
        BytesColumnVector bytesColVector = (BytesColumnVector) sourceColVector;
        byte[] bytes = bytesColVector.vector[0];
        final int start = bytesColVector.start[0];
        final int length = bytesColVector.length[0];
        if (setByValue) {
          ((BytesColumnVector) targetColVector).setVal(0, bytes, start, length);
        } else {
          ((BytesColumnVector) targetColVector).setRef(0, bytes, start, length);
        }
      }
      break;
    case DECIMAL:
      ((DecimalColumnVector) targetColVector).set(
          0, ((DecimalColumnVector) sourceColVector).vector[0]);
      break;
    case TIMESTAMP:
      ((TimestampColumnVector) targetColVector).set(
          0, ((TimestampColumnVector) sourceColVector).asScratchTimestamp(0));
      break;
    case INTERVAL_DAY_TIME:
      ((IntervalDayTimeColumnVector) targetColVector).set(
          0, ((IntervalDayTimeColumnVector) sourceColVector).asScratchIntervalDayTime(0));
      break;
    case STRUCT:
    case LIST:
    case MAP:
    case UNION:
      // No complex type support for now.
    default:
      throw new RuntimeException("Unexpected column vector type " + sourceColVector.type);
    }
  }
Iterates thru all the columns in a given row and populates the batch
from a given offset

@param row Deserialized row object
@param oi Object insepector for that row
@param rowIndex index to which the row should be added to batch
@param batch Vectorized batch to which the row is added at rowIndex
@param context context object for this vectorized batch
@param buffer
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizedBatchUtil.java