hubgeter commented on code in PR #58224:
URL: https://github.com/apache/doris/pull/58224#discussion_r2552629466
##########
fe/be-java-extensions/iceberg-metadata-scanner/src/main/java/org/apache/doris/iceberg/IcebergSysTableJniScanner.java:
##########
@@ -105,24 +105,29 @@ private void nextScanTask() throws IOException {
@Override
protected int getNext() throws IOException {
try (ThreadClassLoaderContext ignored = new
ThreadClassLoaderContext(classLoader)) {
- int rows = 0;
- while (rows < getBatchSize()) {
+
+ List<StructLike> records = new ArrayList<>();
+ while (records.size() < getBatchSize()) {
while (!reader.hasNext() && scanTasks.hasNext()) {
nextScanTask();
}
if (!reader.hasNext()) {
break;
}
- StructLike row = reader.next();
+ records.add(reader.next());
Review Comment:
I don’t think it will consume much memory, because at most there will only
be one batch of data at a time. The reason for storing this data before calling
`append` is that I think some data-retrieval methods might be lazily loaded, so
I separated the `reader.next()` call from the `append` method.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]