Skip to content

[59_maintenance] Fix sliced sparse union ArrayData conversion - #11679

Merged
alamb merged 2 commits into
apache:59_maintenancefrom
Jefffrey:backport_11649
Oct 19, 2026
Merged

alamb merged 2 commits into
apache:59_maintenancefrom
Jefffrey:backport_11649

Conversation

@Jefffrey

Copy link
Copy Markdown
Contributor

skyon0522-ai and others added 2 commits October 18, 2026 22:34
# Which issue does this PR close?

- Closes apache#11582

# 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.
@github-actions github-actions Bot added the arrow-core Core crates related to representing arrow data label Oct 18, 2026
@Jefffrey Jefffrey added the bug label Oct 18, 2026
@Jefffrey
Jefffrey marked this pull request as ready for review October 18, 2026 13:55

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me -- thank you @Jefffrey

@alamb
alamb merged commit 7d225a4 into apache:59_maintenance Oct 19, 2026
31 checks passed
@Jefffrey
Jefffrey deleted the backport_11649 branch October 21, 2026 10:55
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants