pvary commented on code in PR #17296:
URL: https://github.com/apache/iceberg/pull/17296#discussion_r3665186276
##########
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:
This is very strange to me.
Do you happen to know why we create 0 sized vector, and nulls?
Should we do this the other way around, and create DEFAULT_BATCH_SIZE stuff
if the user sets 0?
--
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]