Skip to content

GH-50105: [C++][Python] Fix sliced sparse union null checks#50108

Open
fenfeng9 wants to merge 1 commit into
apache:mainfrom
fenfeng9:issue-50105-sparse-union-element-access
Open

GH-50105: [C++][Python] Fix sliced sparse union null checks#50108
fenfeng9 wants to merge 1 commit into
apache:mainfrom
fenfeng9:issue-50105-sparse-union-element-access

Conversation

@fenfeng9
Copy link
Copy Markdown
Contributor

@fenfeng9 fenfeng9 commented Jun 5, 2026

Rationale for this change

Sliced sparse unions could report incorrect nullness during element access.
The type id lookup used the union offset, but the child null check still used the slice-relative index.

What changes are included in this PR?

  • Updates IsNullSparseUnion and ArraySpan::IsNullSparseUnion in data.cc to use the parent offset when checking child nullness.
  • Add C++ and Python regression tests.

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

@fenfeng9 fenfeng9 requested review from AlenkaF, raulcd and rok as code owners June 5, 2026 16:43
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

⚠️ GitHub issue #50105 has been automatically assigned in GitHub to PR creator.

@fenfeng9
Copy link
Copy Markdown
Contributor Author

fenfeng9 commented Jun 5, 2026

By the way, there seems to be another sparse union-related bug. I'll take a closer look tomorrow, and if I can confirm it, I'll open a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant