private VectorizedRowBatch createTruncatedBufferedBatch(BufferedVectorizedRowBatch bufferedBatch,
      int startIndexWithinBatch, int endIndexWithinBatch) {
    partialBatch.reset();

    // Copy critical columns.
    final int size = endIndexWithinBatch - startIndexWithinBatch + 1;
    for (int i = 0; i < bufferedColumnMap.length; i++) {
      VectorizedBatchUtil.copyNonSelectedColumnVector(bufferedBatch, i,
          partialBatch, i, size, startIndexWithinBatch);
    }

    partialBatch.size = size;
    partialBatch.isLastGroupBatch = bufferedBatch.isLastGroupBatch;
    partialBatch.isInputExpressionEvaluated = bufferedBatch.isInputExpressionEvaluated;
    return partialBatch;
  }
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