public static void addRowToBatchFrom(Object row, StructObjectInspector oi,
                                   int rowIndex,
                                   int colOffset,
                                   VectorizedRowBatch batch,
                                   DataOutputBuffer buffer
                                   ) throws HiveException {
    List<? extends StructField> fieldRefs = oi.getAllStructFieldRefs();
    final int off = colOffset;
    // Iterate thru the cols and load the batch
    for (int i = 0; i < fieldRefs.size(); i++) {
      setVector(row, oi, fieldRefs.get(i), batch, buffer, rowIndex, i, off);
    }
  }
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 colOffset offset from where the column begins
@param batch Vectorized batch to which the row is added at rowIndex
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizedBatchUtil.java