private RowPositionInBatch getRowPositionFromBufferedBatches(int row) throws HiveException {
    int batchIndex = findInMemoryBatchIndex(row);
    return new RowPositionInBatch(null, /* batchIndex */batchIndex,
        row - inMemoryStartRowIndex.get(batchIndex));
  }
Finds the batch which contains a given row with binary search. The row reflects a global row
number within the partition, so as the values in inMemoryStartRowIndex. This method assumes
that the caller loaded the needed block into memory, and refresh the index via
refreshInMemoryStartRowIndex.

@param row
@return batchIndex
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/ptf/VectorPTFGroupBatches.java