Repository navigation
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? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed exact head 3ca767e against main db4edb4. No concrete blocker found.
The fix clears only the DISTINCT flag before consulting the aggregate executor's canonical empty-input contract. It does not remove DISTINCT from the aggregate plan or change its arguments/state. Thus a missing equality-correlated group restores COUNT(DISTINCT) to typed zero, while SUM/AVG/GROUP_CONCAT remain NULL; a matching all-NULL group retains the same outcomes, and populated groups retain their computed distinct result. The mask is identical to the existing aggregate-ID convention and leaves ordinary aggregate IDs unchanged.
I traced both direct AGG and PROJECT->AGG callers, post-LEFT-JOIN expression restoration, copied projection expressions, correlation-key ownership and existing eligibility guards. Explicit grouping, HAVING/row-removing wrappers, LIMIT and unsupported shapes are not newly pulled through this helper. No join predicate, dedup implementation, partial/final state format, prepared parameter ownership or persisted metadata changes. The added work is one planner-time bitmask; no new per-row allocation or resource lifetime.
The typed tests prove COUNT gets its zero-producing CASE while NULL-on-empty aggregates retain the projected expression, and plan tests prove the supported correlated DISTINCT forms become reachable without correlated expressions. The public SQL oracle uses duplicate non-NULL values, a matching all-NULL group and a completely missing group, with independently specified null-safe expected results and deterministic concatenation order. These distinguish the target failure rather than merely accepting generated output.
Validation/limits: complete four-file diff, issue #28300, PR comments/history and exact-head planner/empty-result consumers inspected; head/base rechecked before posting. I did not independently run UT/BVT, mixed-version/distributed SQL or performance tests, and did not wait for CI. Broader decorrelation coverage is useful existing/follow-up evidence, not a blocker for this localized ID-classification correction.
Merge Queue Status
This pull request spent 3 minutes 44 seconds in the queue, with no time running CI. ReasonThe pull request can't be updated
HintYou should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again. Tick the box to put this pull request back in the merge queue (same as
|
…xorigin#28642) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#28300 ## What this PR does / why we need it: fix(plan): restore empty correlated DISTINCT aggregate results --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…xorigin#28642) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#28300 ## What this PR does / why we need it: fix(plan): restore empty correlated DISTINCT aggregate results --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
…xorigin#28642) ## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#28300 ## What this PR does / why we need it: fix(plan): restore empty correlated DISTINCT aggregate results --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #28300
What this PR does / why we need it:
fix(plan): restore empty correlated DISTINCT aggregate results