private void refreshInMemoryStartRowIndex(VectorSpillBlock block) {
    inMemoryStartRowIndex = new ArrayList<>();

    if (block == null || !block.isFullySpilled()) {
      inMemoryStartRowIndex.add(block == null ? 0 : block.startRowIndex[0]);
      for (int i = 1; i < currentBufferedBatchCount + 1; i++) {
        inMemoryStartRowIndex
            .add(inMemoryStartRowIndex.get(i - 1) + bufferedBatches.get(i - 1).size);
      }
    } else {
      for (int i = 0; i < block.startRowIndex.length; i++) {
        inMemoryStartRowIndex.add(block.startRowIndex[i]);
      }
      inMemoryStartRowIndex =
          Arrays.stream(block.startRowIndex).boxed().collect(Collectors.toList());
      inMemoryStartRowIndex.add((int) (block.startRowIndex[0] + block.spillRowCount));
    }
  }
Returns the values of ordering columns from a given batch and given row in an Object[].
@param vectorizedRowBatch
@param rowIndexInBatch
@return
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/ptf/VectorPTFGroupBatches.java