Skip to content

fix(arrow-data): fix gaps in ListView equality - #11345

Merged
Jefffrey merged 1 commit into
apache:mainfrom
neilconway:neilc/fix-list-view-equal
Oct 3, 2026
Merged

Jefffrey merged 1 commit into
apache:mainfrom
neilconway:neilc/fix-list-view-equal

Conversation

@neilconway

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

  • N/A

Rationale for this change

list_view_equal had two bugs:

  • When both arrays had null rows, it compared each non-null row using the size of the LHS only. For example, [[1, 2], null] was considered equal to [[1, 2, 3], null].
  • Rows that differed only in their null masks were not handled correctly: they were either incorrectly considered equal, or the comparison resulted in a panic.

What changes are included in this PR?

  • Fix ListView equality bugs
  • Add unit tests

Are these changes tested?

Yes; existing tests pass, new tests added.

Are there any significant user-facing changes?

No.

AI usage

Developed with Claude Code (Opus 5.5).

`list_view_equal` had two gaps:

- When either array had null rows, it compared each non-null row using the
  left-hand size only, so `[[1, 2], null]` equaled `[[1, 2, 3], null]`.
- It compared child values with `equal_values`, which assumes the null
  masks were already checked. Child values that differed only in their
  nulls compared equal, or panicked on an `unwrap` when only the left-hand
  child had nulls.

Compare the right-hand sizes on the null path, and compare child values
with `equal_range`, as `list_equal` does.
@github-actions github-actions Bot added arrow Changes to the arrow crate arrow-data labels Oct 2, 2026
@Jefffrey Jefffrey added the bug Squash those bugs label Oct 3, 2026
@Jefffrey
Jefffrey added this pull request to the merge queue Oct 3, 2026
@Jefffrey

Jefffrey commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

thanks @neilconway

Merged via the queue into apache:main with commit 862b1e0 Oct 3, 2026
33 checks passed
alamb pushed a commit that referenced this pull request Oct 8, 2026
- Backport #11345
- For inclusion in #11352

Cherry-pick of
862b1e0

---------

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

Cherry-pick of
862b1e0

Co-authored-by: Neil Conway <[email protected]>
alamb pushed a commit that referenced this pull request Oct 22, 2026
- Backport #11345
- For inclusion in #11666

Cherry-pick of
862b1e0

Co-authored-by: Neil Conway <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate arrow-data bug Squash those bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants