Skip to content

fix(arrow-data): check view nulls at the right index in ArrayData equality - #11642

Merged
Jefffrey merged 1 commit into
apache:mainfrom
ump45nose:fix/byte-view-equal-null-index
Oct 18, 2026
Merged

Jefffrey merged 1 commit into
apache:mainfrom
ump45nose:fix/byte-view-equal-null-index

Conversation

@ump45nose

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

When a list, list view, fixed-size list or struct compares a Utf8View / BinaryView child range that doesn't start at 0, byte_view_equal read the null bit of the wrong child slot. Arrays that only differ in the data under a null compared unequal, and a real difference in a valid slot could be skipped and compare equal.

What changes are included in this PR?

byte_view_equal now checks lhs.is_null(lhs_start + idx) instead of lhs.is_null(idx), since idx counts from the start of the compared range. The views it compares were already offset by lhs_start, so this only lines the null check up with them.

Are these changes tested?

Yes. test_list_of_view_child_nulls_past_start in arrow/tests/array_equal.rs builds a two-row list over a Utf8View and a BinaryView child and compares the second row sliced off, covering both directions: two [[null]] values with different hidden data (now equal) and two valid rows with different values next to a null at child index 0 (now unequal). It fails without the fix.

Are there any significant user-facing changes?

No.

AI disclosure: I used an AI coding assistant to write the fix, the test and this description, and I reviewed all of it.

@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 02:22
@Jefffrey
Jefffrey added this pull request to the merge queue Oct 18, 2026
Merged via the queue into apache:main with commit c097092 Oct 18, 2026
35 checks passed
alamb pushed a commit that referenced this pull request Oct 19, 2026
… in `ArrayData` equality (#11675)

- Backport #11642
- For inclusion in #11664

Cherry-pick of
c097092

Co-authored-by: ump45nose <[email protected]>
Co-authored-by: ump45nose <[email protected]>
Jefffrey added a commit that referenced this pull request Oct 22, 2026
… in `ArrayData` equality (#11758)

- Backport #11642
- For inclusion in #11665

Cherry-pick of
c097092

Co-authored-by: ump45nose <[email protected]>
Co-authored-by: ump45nose <[email protected]>
Co-authored-by: Andrew Lamb <[email protected]>
alamb pushed a commit that referenced this pull request Oct 22, 2026
… in `ArrayData` equality (#11811)

- Backport #11642
- For inclusion in #11666

Cherry-pick of
c097092

Co-authored-by: ump45nose <[email protected]>
Co-authored-by: ump45nose <[email protected]>
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.

ArrayData equality of view arrays checks nulls at the wrong index when the compared range does not start at 0

2 participants