fix(arrow/scalar): handle zero-length scalar arrays - #1116
Conversation
ed93c2c to
44d577b
Compare
zeroshade
left a comment
There was a problem hiding this comment.
The zero-length handling is correct. Empty arrays retain their data types, validate fully, and clean up correctly across nested, dictionary, union, extension, and run-end encoded scalars. The focused, race, 32-bit, vet, and CI checks pass.
Please rebase this branch onto current main before merging. Both touched files now conflict; the resolution should retain this zero-length branch and tests alongside main’s newer MakeArrayFromScalar offset-width fixes and associated tests.
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.
44d577b to
12ae302
Compare
Rationale for this change
MakeArrayFromScalar accepts a length of zero, but nested scalar types try to concatenate an empty input. Run-end encoded scalars also need an empty physical representation.
What changes are included in this PR?
Use empty builders for zero-length output and construct run-end encoded arrays with zero runs. Add coverage for nested and run-end encoded scalars.
Are these changes tested?
go test ./arrow/scalarAre there any user-facing changes?
No API changes. This corrects the reported behavior while preserving the existing ownership and compatibility contracts.