Anurag-S1ngh opened a new pull request, #19281:
URL: https://github.com/apache/iceberg/pull/19281

   ## Summary
   
   - `VectorizedArrowReader` multiplied the batch size by a width when calling 
`setInitialCapacity`, but that argument is a value count. Variable-width 
vectors reserved offsets for `batchSize * averageWidth` values, and fixed-width 
binary and INT96 vectors over-reserved by their type width.
   - Use the value-count APIs: `setInitialCapacity(batchSize)` for fixed-width 
vectors and the density-aware `setInitialCapacity(batchSize, averageWidth)` for 
variable-width vectors.
   
   ## Changes
   
   - `VectorizedArrowReader`: fix the allocations for BINARY, 
FIXED_LEN_BYTE_ARRAY, INT96, enum/json/bson strings, and the variant metadata 
vector.
   - Add `TestVectorInitialCapacity`, asserting the vectors hold a batch of 
rows without reserving `batchSize * width`.
   
   ## Testing
   
   - `./gradlew :iceberg-arrow:test` passes.
   - Both new tests fail on the unmodified reader with the over-reserved 
capacities.
   - `spotlessApply` run for the module.
   
   Closes #17305
   


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