Skip to content

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

Merged
alamb merged 1 commit into
apache:57_maintenancefrom
Jefffrey:backport_11643_57
Oct 22, 2026
Merged

alamb merged 1 commit into
apache:57_maintenancefrom
Jefffrey:backport_11643_57

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.
@Jefffrey Jefffrey added the bug label Oct 22, 2026
@github-actions github-actions Bot added the arrow-core Core crates related to representing arrow data label Oct 22, 2026
@Jefffrey
Jefffrey marked this pull request as ready for review October 22, 2026 12:24
@alamb
alamb merged commit ecd340d into apache:57_maintenance Oct 22, 2026
26 checks passed
@Jefffrey
Jefffrey deleted the backport_11643_57 branch October 22, 2026 21:51
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