@Override public int getReturnedRowCount() { return recordBatches.getSize(); }
private Pair<RecordBatchData, Integer> find(int index) { if (index >= recordBatches.getSize()) { throw new IllegalArgumentException(String.format("Invalid index %s", index)); } // Add the offset in the first batch int indexWorkspace = index; for(RecordBatchHolder batchHolder : recordBatches.getBatches()) { if (indexWorkspace < batchHolder.size()) { return new Pair<>(batchHolder.getData(), batchHolder.getStart() + indexWorkspace); } indexWorkspace -= batchHolder.size(); } throw new IllegalArgumentException(String.format("Invalid index %s", index)); }