public static void resetNonPartitionColumns(VectorizedRowBatch rowBatch) {
    List<Integer> columnsToReset = IntStream.concat(
            IntStream.range(0, rowBatch.getDataColumnCount()),
            IntStream.range(rowBatch.getDataColumnCount() + rowBatch.getPartitionColumnCount(), rowBatch.cols.length)
    ).boxed().collect(toList());
    rowBatch.reset(columnsToReset);
  }
Reset all columns other than Partition columns
@param rowBatch VectorizedRowBatch to reset
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizedBatchUtil.java