fix(arrow/array): bound table reader batches - #1146
Conversation
zeroshade
left a comment
There was a problem hiding this comment.
The logical-row bound looks correct. Using tr.max - tr.cur ensures the final record batch cannot extend beyond the table's declared row count while preserving the existing per-column chunk-boundary behavior.
I exercised the change across truncated tables, uneven and empty multi-column chunks, zero and negative chunk sizes, repeated iteration, and record ownership. The focused regression, race stress, full arrow/array package, and broader boundary properties all pass. CI is green.
This review was drafted by an AI-assisted tool and confirmed by an Apache Arrow Go maintainer. The maintainer approving this PR has read the findings and signed off. If something feels off, please reply on the PR and a maintainer will follow up.
More on how Apache Arrow Go handles maintainer review: CONTRIBUTING.md.
What
NewTable permits a column to be longer than the logical table row count. TableReader used the absolute row limit when choosing each batch size, so a 5-row table could emit a second batch that crossed the logical end. This uses the remaining row count.
Test