fix: reject groups accumulator for distinct bitwise aggregates - #24989
Open
jackylee-ch wants to merge 1 commit into
Open
fix: reject groups accumulator for distinct bitwise aggregates#24989jackylee-ch wants to merge 1 commit into
jackylee-ch wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #24989 +/- ##
==========================================
- Coverage 81.67% 81.67% -0.01%
==========================================
Files 1126 1126
Lines 414524 414524
Branches 414524 414524
==========================================
- Hits 338558 338545 -13
- Misses 56054 56062 +8
- Partials 19912 19917 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jayzhan211
previously approved these changes
Sep 7, 2026
jayzhan211
left a comment
Contributor
There was a problem hiding this comment.
Thanks @jackylee-ch 👍🏻
jayzhan211
reviewed
Sep 7, 2026
| fn groups_accumulator_supported(&self, _args: AccumulatorArgs) -> bool { | ||
| true | ||
| fn groups_accumulator_supported(&self, args: AccumulatorArgs) -> bool { | ||
| !args.is_distinct |
Contributor
There was a problem hiding this comment.
Should we limit operator to XOR only, since AND and OR are idempotent so DISTINCT does not change their result and they keep the vectorized path.
Also, do we need to handle null case? This could be a follow-up issue
Suggested change
| !args.is_distinct | |
| !(args.is_distinct && self.operation == BitwiseOperationType::Xor) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
bit_xor(DISTINCT c)withGROUP BYfails withInvalid argument error: column types must match schema types, expected List(Int16) but found Int16.groups_accumulator_supportedignoredis_distinct, so the plan got the non-distinctPrimitiveGroupsAccumulatorwhilestate_fieldsdeclared the distinctListstate. XOR is also not idempotent, so duplicates change the result:5 ^ 5 ^ 9 = 9but5 ^ 9 = 12.What changes are included in this PR?
groups_accumulator_supportednow returns!args.is_distinct, matchingsum,avgandcount.What is the testing strategy for this PR?
Two
aggregate.sltqueries covering the two shapesSingleDistinctToGroupBydoes not rewrite (a non-distinct aggregate alongside, and aFILTER). Both fail onmainwith the error above and pass with this change.Are there any user-facing changes?
bit_and/bit_or/bit_xorwithDISTINCTandGROUP BYnow return correct results. No API change.