Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public class PaimonJniScanner extends JniScanner {
private long dbId;
private long tblId;
private long lastUpdateTime;
private RecordReader.RecordIterator<InternalRow> recordIterator = null;

public PaimonJniScanner(int batchSize, Map<String, String> params) {
LOG.debug("params:{}", params);
Expand Down Expand Up @@ -133,18 +134,25 @@ public void close() throws IOException {
protected int getNext() throws IOException {
int rows = 0;
try {
RecordReader.RecordIterator<InternalRow> batch;
while ((batch = reader.readBatch()) != null) {
if (recordIterator == null) {
recordIterator = reader.readBatch();
}

while (recordIterator != null) {
InternalRow record;
while ((record = batch.next()) != null) {
while ((record = recordIterator.next()) != null) {
columnValue.setOffsetRow(record);
for (int i = 0; i < fields.length; i++) {
columnValue.setIdx(i, types[i]);
appendData(i, columnValue);
}
rows++;
if (rows >= batchSize) {
return rows;
}
}
batch.releaseBatch();
recordIterator.releaseBatch();
recordIterator = reader.readBatch();
}
} catch (IOException e) {
LOG.warn("failed to getNext columnValue ", e);
Expand Down