Skip to content

fix(arrow/scalar): handle zero-length scalar arrays - #1116

Merged
zeroshade merged 1 commit into
apache:mainfrom
fallintoplace:fix/scalar-zero-length-arrays
Aug 14, 2026
Merged

fix(arrow/scalar): handle zero-length scalar arrays#1116
zeroshade merged 1 commit into
apache:mainfrom
fallintoplace:fix/scalar-zero-length-arrays

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

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

Are there any user-facing changes?

No API changes. This corrects the reported behavior while preserving the existing ownership and compatibility contracts.

@fallintoplace fallintoplace changed the title fix(arrow/scalar): support zero-length scalar arrays fix(arrow/scalar): build empty arrays from zero-length scalars Aug 5, 2026
@fallintoplace fallintoplace changed the title fix(arrow/scalar): build empty arrays from zero-length scalars fix(arrow/scalar): handle zero-length scalar arrays Aug 6, 2026
@fallintoplace
fallintoplace force-pushed the fix/scalar-zero-length-arrays branch from ed93c2c to 44d577b Compare August 6, 2026 17:36

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

@fallintoplace
fallintoplace force-pushed the fix/scalar-zero-length-arrays branch from 44d577b to 12ae302 Compare August 12, 2026 20:58
@zeroshade
zeroshade merged commit b497053 into apache:main Aug 14, 2026
23 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