pvary commented on code in PR #17296:
URL: https://github.com/apache/iceberg/pull/17296#discussion_r3665637665


##########
arrow/src/main/java/org/apache/iceberg/arrow/vectorized/VectorizedArrowReader.java:
##########
@@ -882,12 +921,47 @@ public void setBatchSize(int batchSize) {
         this.nulls = newNullabilityHolder(batchSize);
       }
 
+      // release the result vector when the batch grows, so the next read 
allocates a vector that
+      // fits the new batch size
+      if (vec != null && vec.getValueCapacity() < batchSize) {
+        vec.close();
+        this.vec = null;
+      }
+
+      this.resultBatchSize = (batchSize == 0) ? DEFAULT_BATCH_SIZE : batchSize;

Review Comment:
   We might want to ask @amogh-jahagirdar to review.
   He might have more context as he was the one who added the last readers.



-- 
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]

Reply via email to