Skip to content

GH-50113: [C++][Python] Fix count for sliced union arrays#50114

Open
fenfeng9 wants to merge 1 commit into
apache:mainfrom
fenfeng9:issue-50113-union-count-null-offsets
Open

GH-50113: [C++][Python] Fix count for sliced union arrays#50114
fenfeng9 wants to merge 1 commit into
apache:mainfrom
fenfeng9:issue-50113-union-count-null-offsets

Conversation

@fenfeng9
Copy link
Copy Markdown
Contributor

@fenfeng9 fenfeng9 commented Jun 6, 2026

Rationale for this change

Sliced union arrays could report incorrect results from count.

For sliced union arrays, span.GetValues<int8_t>(1) and span.GetValues<int32_t>(2) already return offset-adjusted pointers. The logical null count path then indexed those pointers with span.offset + i, effectively applying the parent offset twice.
The sparse union path also checked child nullness with i instead of span.offset + i.

What changes are included in this PR?

  • Fixes logical null counting for sliced sparse and dense union arrays.
  • 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 6, 2026 16:01
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 6, 2026

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

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