public static String[] columnNamesFromStructObjectInspector(
      StructObjectInspector structObjectInspector) throws HiveException {

    List<? extends StructField> fields = structObjectInspector.getAllStructFieldRefs();
    String[] result = new String[fields.size()];

    int i = 0;
    for(StructField field : fields) {
      result[i++] =  field.getFieldName();
    }
    return result;
  }
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