Skip to content

Fix sliced sparse union ArrayData conversion - #11649

Merged
Jefffrey merged 1 commit into
apache:mainfrom
skyon0522-ai:codex/fix-sparse-union-arraydata-slice
Oct 18, 2026
Merged

Jefffrey merged 1 commit into
apache:mainfrom
skyon0522-ai:codex/fix-sparse-union-arraydata-slice

Conversation

@skyon0522-ai

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Converting sliced sparse union ArrayData into an array currently reads values outside the slice. A single-child union can also return a logical null mask longer than the resulting array.

What changes are included in this PR?

Apply the parent offset and length to sparse child data before constructing the child arrays. Dense children retain their existing offsets and lengths.

Are these changes tested?

Regression tests compare conversion from sliced ArrayData with direct union slicing, including nonzero offsets, truncation at offset zero, empty slices, custom type IDs, nullable values, and a dense-union control.

AI assistance was used to analyze the conversion path and draft the code, regression tests, and this description.

Are there any significant user-facing changes?

No public API changes.

Slice sparse child data by the parent offset and length before building
UnionArray children. Cover value alignment, logical nulls and dense controls.

Assisted-by: OpenAI Codex
@github-actions github-actions Bot added the arrow-core Core crates related to representing arrow data label Oct 17, 2026
@Jefffrey Jefffrey added the bug Squash those bugs label Oct 18, 2026
@Jefffrey
Jefffrey enabled auto-merge October 18, 2026 03:10
@Jefffrey
Jefffrey added this pull request to the merge queue Oct 18, 2026
Merged via the queue into apache:main with commit a934112 Oct 18, 2026
35 checks passed
alamb pushed a commit that referenced this pull request Oct 19, 2026
- Backport #11649
- For inclusion in #11664

Cherry-pick of
a934112

---------

Co-authored-by: Kyon <[email protected]>
alamb pushed a commit that referenced this pull request Oct 21, 2026
- Backport #11649
- For inclusion in #11665

Cherry-pick of
a934112

---------

Co-authored-by: Kyon <[email protected]>
alamb pushed a commit that referenced this pull request Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow-core Core crates related to representing arrow data bug Squash those bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make_array of a sliced sparse union ArrayData reads unsliced children

2 participants