Repository navigation
fix(window): evaluate cumulative sum frames linearly - #27006
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
LeftHandCold
left a comment
There was a problem hiding this comment.
Reviewed exact head 2b250e3. The linear path is gated to runtime ROWS frames equivalent to partition-start through CURRENT ROW and to aggregate executors whose Merge preserves the running source. I checked source-merge behavior, finite/prepared bounds, NULL/decimal behavior, chunk and partition continuation, cancellation/error cleanup, LIMIT-triggered Reset, and fallback for other aggregates. I found no reachable correctness, lifecycle, or normal-business regression blocker; required CI is green.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed exact head 2b250e3. The linear evaluator is correctly gated to ROWS frames equivalent to partition-start through CURRENT ROW and to aggregate executors with source-preserving Merge. I checked finite/prepared bounds, chunk and partition continuation, NULL/decimal semantics, cancellation/error/early-Reset cleanup, and fallback for consuming aggregate states. CGo tests for aggexec/window pass; the issue-shape benchmark is ~1.53 ms/op locally. No blocker found.
Merge Queue Status
This pull request spent 38 minutes 7 seconds in the queue, with no time running CI. ReasonPull request #27006 has been merged manually at 052b2fd HintYou were too fast! Tick the box to put this pull request back in the merge queue (same as
|
) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#23107 ## What this PR does / why we need it: Recognizes ROWS frames ending at CURRENT ROW whose PRECEDING bound covers the runtime partition and evaluates SUM/AVG with one source-preserving running aggregate state. This avoids replaying every prefix for every output row while retaining state across bounded output chunks and resetting it at partition boundaries. Aggregate executors must explicitly opt into the source-preserving Merge contract; aggregates whose Merge may consume the source retain the existing evaluator. Adds prepared-bound, partition, NULL, cancellation, early Reset, multi-chunk, SQL regression, and benchmark coverage. The first-batch benchmark for the issue shape improves from about 3.0 s to about 1.25 ms locally. Tests: - .agents/skills/mo-dev/scripts/mo-cgo-test ./pkg/sql/colexec/aggexec ./pkg/sql/colexec/window -count=1 - .agents/skills/mo-dev/scripts/mo-cgo-test ./pkg/sql/colexec/window -run '^$' -bench '^BenchmarkWindowFirstBatch$' -benchtime=5x -count=1 Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#23107 ## What this PR does / why we need it: Recognizes ROWS frames ending at CURRENT ROW whose PRECEDING bound covers the runtime partition and evaluates SUM/AVG with one source-preserving running aggregate state. This avoids replaying every prefix for every output row while retaining state across bounded output chunks and resetting it at partition boundaries. Aggregate executors must explicitly opt into the source-preserving Merge contract; aggregates whose Merge may consume the source retain the existing evaluator. Adds prepared-bound, partition, NULL, cancellation, early Reset, multi-chunk, SQL regression, and benchmark coverage. The first-batch benchmark for the issue shape improves from about 3.0 s to about 1.25 ms locally. Tests: - .agents/skills/mo-dev/scripts/mo-cgo-test ./pkg/sql/colexec/aggexec ./pkg/sql/colexec/window -count=1 - .agents/skills/mo-dev/scripts/mo-cgo-test ./pkg/sql/colexec/window -run '^$' -bench '^BenchmarkWindowFirstBatch$' -benchtime=5x -count=1 Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#23107 ## What this PR does / why we need it: Recognizes ROWS frames ending at CURRENT ROW whose PRECEDING bound covers the runtime partition and evaluates SUM/AVG with one source-preserving running aggregate state. This avoids replaying every prefix for every output row while retaining state across bounded output chunks and resetting it at partition boundaries. Aggregate executors must explicitly opt into the source-preserving Merge contract; aggregates whose Merge may consume the source retain the existing evaluator. Adds prepared-bound, partition, NULL, cancellation, early Reset, multi-chunk, SQL regression, and benchmark coverage. The first-batch benchmark for the issue shape improves from about 3.0 s to about 1.25 ms locally. Tests: - .agents/skills/mo-dev/scripts/mo-cgo-test ./pkg/sql/colexec/aggexec ./pkg/sql/colexec/window -count=1 - .agents/skills/mo-dev/scripts/mo-cgo-test ./pkg/sql/colexec/window -run '^$' -bench '^BenchmarkWindowFirstBatch$' -benchtime=5x -count=1 Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
issue #23107
What this PR does / why we need it:
Recognizes ROWS frames ending at CURRENT ROW whose PRECEDING bound covers the runtime partition and evaluates SUM/AVG with one source-preserving running aggregate state. This avoids replaying every prefix for every output row while retaining state across bounded output chunks and resetting it at partition boundaries.
Aggregate executors must explicitly opt into the source-preserving Merge contract; aggregates whose Merge may consume the source retain the existing evaluator.
Adds prepared-bound, partition, NULL, cancellation, early Reset, multi-chunk, SQL regression, and benchmark coverage. The first-batch benchmark for the issue shape improves from about 3.0 s to about 1.25 ms locally.
Tests: