in paimon-presto-common/src/main/java/org/apache/paimon/presto/PrestoPageSourceBase.java [134:156]
private Page nextPage() throws IOException {
RecordReader.RecordIterator<InternalRow> batch = reader.readBatch();
if (batch == null) {
isFinished = true;
return null;
}
InternalRow row;
while ((row = batch.next()) != null) {
pageBuilder.declarePosition();
for (int i = 0; i < prestoColumnTypes.size(); i++) {
BlockBuilder output = pageBuilder.getBlockBuilder(i);
appendTo(
prestoColumnTypes.get(i),
paimonColumnTypes.get(i),
InternalRowUtils.get(row, i, paimonColumnTypes.get(i)),
output);
}
}
batch.releaseBatch();
Page page = pageBuilder.build();
pageBuilder.reset();
return page;
}