Skip to content

fix(arrow/array): bound table reader batches - #1146

Merged
zeroshade merged 1 commit into
apache:mainfrom
fallintoplace:fix/table-reader-row-count
Aug 11, 2026
Merged

fix(arrow/array): bound table reader batches#1146
zeroshade merged 1 commit into
apache:mainfrom
fallintoplace:fix/table-reader-row-count

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

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

  • go test ./arrow/array -run TestTableReaderDoesNotExceedTableRowCount -count=1

@fallintoplace
fallintoplace marked this pull request as ready for review August 8, 2026 15:52

@zeroshade zeroshade left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@zeroshade
zeroshade merged commit 2d4c385 into apache:main Aug 11, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants