Repository navigation
fix: Return NULL for empty BIT_XOR sliding windows - #26095
Draft
geoffreyclaude wants to merge 1 commit into
Draft
geoffreyclaude wants to merge 1 commit into
geoffreyclaude wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #26095 +/- ##
=========================================
Coverage 82.72% 82.72%
=========================================
Files 1147 1147
Lines 448179 449287 +1108
Branches 448179 449287 +1108
=========================================
+ Hits 370754 371674 +920
- Misses 54895 54935 +40
- Partials 22530 22678 +148 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
geoffreyclaude
force-pushed
the
fix/sliding-bit-xor-empty-frame
branch
from
October 7, 2026 07:03
aef243b to
436baf5
Compare
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?
No existing issue. The SQL regression below reproduces the bug on current main.
Rationale for this change
BIT_XOR returns 0 instead of NULL after the last non-null value leaves a sliding window. For values 7, NULL, 9, a window containing only the preceding row produces NULL, 7, 0; the correct results are NULL, 7, NULL.
What changes are included in this PR?
Add a sliding BIT_XOR accumulator that tracks the remaining non-null count alongside the XOR value. This distinguishes an empty aggregate from a nonempty aggregate whose values cancel to zero.
The sliding factory supplies this accumulator. The ordinary accumulator no longer advertises retraction support. Ordinary scalar and grouped aggregation retain their existing one-field state and groups implementation.
What is the testing strategy for this PR?
Rust tests cover the public sliding factory's zero/NULL transitions, merging partial states with correct input counts, and the ordinary/DISTINCT factory contracts.
bit_xor_sliding_window.sltexercises all eight integer types across batch boundaries, including empty and all-null frames, actual zero, and cancelling values.Are there any user-facing changes?
Sliding BIT_XOR windows return NULL after all non-null inputs leave. Callers that need retraction should request the sliding accumulator; the ordinary factory reports that it does not support retraction.