Skip to content

[59_maintenance] fix(arrow-array): use the field's type id in dense union logical_nulls - #11680

Merged
alamb merged 1 commit into
apache:59_maintenancefrom
Jefffrey:backport_11643
Oct 19, 2026
Merged

alamb merged 1 commit into
apache:59_maintenancefrom
Jefffrey:backport_11643

Conversation

@Jefffrey

Copy link
Copy Markdown
Contributor

apache#11643)

# Which issue does this PR close?

- Closes apache#11595.

# Rationale for this change

A dense union with a single field whose type id is not 0 reported no
logical nulls, so `logical_null_count`, `is_null` and `is_not_null` were
wrong for it.

# What changes are included in this PR?

The single-field path of `UnionArray::logical_nulls` passed the child
nulls to `gather_nulls` under type id 0. It now passes the field's own
type id, enumerating `self.fields` the same way `fields_logical_nulls`
does.

# Are these changes tested?

Yes, `test_dense_union_one_field_nonzero_type_id_logical_nulls`. It
fails without the fix.

# Are there any significant user-facing changes?

No.

AI use: I used Claude Code to find the cause and write the fix and test.
I reviewed the change and checked that the test fails without the fix.
@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.

Verified this is a clean backport. Thank you @Jefffrey

@alamb
alamb merged commit cc8196a into apache:59_maintenance Oct 19, 2026
31 checks passed
@Jefffrey
Jefffrey deleted the backport_11643 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