anoopj commented on code in PR #17645:
URL: https://github.com/apache/iceberg/pull/17645#discussion_r3781230871
##########
arrow/src/main/java/org/apache/iceberg/arrow/vectorized/VectorizedArrowReader.java:
##########
@@ -304,14 +305,21 @@ private void allocateVectorBasedOnTypeName(PrimitiveType
primitive, Field arrowF
this.readType = ReadType.FIXED_WIDTH_BINARY;
}
this.vec = arrowField.createVector(rootAlloc);
- vec.setInitialCapacity(batchSize * len);
+ // Fixed-width vectors size their data buffer as valueCount *
typeWidth, so passing a byte
+ // count reserves typeWidth times too many values.
+ vec.setInitialCapacity(batchSize);
Review Comment:
The PR description says fixed length arrays are not modified, so this seem
contradictory. The code change itself looks reasonable. You may want to update
your PR description if this is intentional.
--
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]