private BufferedVectorizedRowBatch newBufferedBatch(VectorizedRowBatch batch) throws HiveException {
    final int bufferedColumnCount = bufferedColumnMap.length;
    BufferedVectorizedRowBatch newBatch = new BufferedVectorizedRowBatch(bufferedColumnCount);
    for (int i = 0; i < bufferedColumnCount; i++) {
      newBatch.cols[i] =
          VectorizedBatchUtil.makeLikeColumnVector(batch.cols[bufferedColumnMap[i]]);
      newBatch.cols[i].init();
    }

    /*
     * At this point, we know the structure of the column batch that we'll use later, so it's time
     * to initialize partialBatch.
     */
    if (partialBatch == null){
      partialBatch = new BufferedVectorizedRowBatch(bufferedColumnMap.length);
      for (int i = 0; i < bufferedColumnCount; i++) {
        partialBatch.cols[i] =
            VectorizedBatchUtil.makeLikeColumnVector(batch.cols[bufferedColumnMap[i]]);
        partialBatch.cols[i].init();
      }
    }
    return newBatch;
  }
Runs the evaluator on a specific range. The provided Ref<Object> is needed because some
evaluators (RANK, DENSE_RANK) are supposed to provide the result before handling the last batch
in a group (doLastBatchWork). For this purposes, a simple return value would not be sufficient.

@param evaluator
@param range
@param result
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/ptf/VectorPTFGroupBatches.java