Skip to content

fix: avoid shifting zero grouping ordinals by 64 - #26136

Open
alexandrefimov wants to merge 1 commit into
apache:mainfrom
alexandrefimov:codex/datafusion-native64-publication-20261008
Open

alexandrefimov wants to merge 1 commit into
apache:mainfrom
alexandrefimov:codex/datafusion-native64-publication-20261008

Conversation

@alexandrefimov

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #26134.

Rationale for this change

A representable 64-column grouping-set query can panic while constructing its grouping ID.

What changes are included in this PR?

Use the semantic mask directly when the duplicate ordinal is zero. Preserve the existing checks for layouts requiring more than 64 bits.

What is the testing strategy for this PR?

Four unit boundary tests plus SQL coverage for both aggregate kernels, real versus rolled-up NULLs, duplicate sets and capacity refusals.

Focused tests, crate tests, extended workspace tests, formatting, all-target/all-feature Clippy and dev/rust_lint.sh passed.

Are there any user-facing changes?

Valid 64-column grouping sets execute successfully. Unrepresentable layouts continue to return NotImplemented.

A unique 64-column grouping set fits the UInt64 representation, but
packing its zero duplicate ordinal shifts by the full width. Use the
semantic mask directly for ordinal zero and preserve the existing
capacity checks for nonzero ordinals.

Add unit boundary tests and SQL coverage for both aggregate kernels,
including real NULL keys, duplicate sets and capacity refusals.
@github-actions github-actions Bot added sqllogictest SQL Logic Tests (.slt) physical-plan Changes to the physical-plan crate labels Oct 8, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.56098% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.74%. Comparing base (102a162) to head (84346c1).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
datafusion/physical-plan/src/aggregates/mod.rs 97.56% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #26136   +/-   ##
=======================================
  Coverage   82.74%   82.74%           
=======================================
  Files        1147     1147           
  Lines      449767   449807   +40     
  Branches   449767   449807   +40     
=======================================
+ Hits       372157   372209   +52     
+ Misses      54942    54932   -10     
+ Partials    22668    22666    -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

physical-plan Changes to the physical-plan crate sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Execution panic for valid 64-column GROUPING SETS

2 participants