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 bb32328f3745c5cd30a54a9805bc7e9507ae6ac7. The Decimal256 variance path preserves exact-origin deltas through resident/DISTINCT aggregation, merge and serialization; the Welford/Chan updates, scale conversion/overflow fallback and planner FLOAT64 return type are consistent. NULL, empty and singleton groups plus stable/legacy state layouts are covered. No concrete correctness or cleanup blocker found. Exact-head CI run 34811552609 passed; new tests use 1–4 row vectors, with no credible ~45s test or major racing-UT cost increase.
## What type of PR is this? - [x] BUG ## Which issue(s) this PR fixes: issue matrixorigin#28838 ## What this PR does / why we need it: Variance and standard-deviation aggregates accepted DECIMAL256 inputs during planning but panicked at runtime in the aggregate executor. The executor factory now routes DECIMAL256 through the existing numeric variance/stddev state machine while preserving the float64 return type and state/wire layout. Exact decimal-origin deviation handling is retained where representable, with a float64 fallback outside that range. The shared DECIMAL256-to-float64 conversion is also corrected at the signed 128-bit boundary. ## Test plan: - Full `pkg/sql/colexec/aggexec` unit and race tests. - Full `pkg/sql/plan/function` unit tests. - Full `pkg/container/types` unit and race tests. - DECIMAL256 resident, DISTINCT, merge, empty/singleton, serialization, planner, and signed-boundary tests. - `make static-check-analysis GOLANGCI_LINT_CONCURRENCY=1` (`0 issues`). - `git diff --check`. All listed tests passed.
## What type of PR is this? - [x] BUG ## Which issue(s) this PR fixes: issue matrixorigin#28838 ## What this PR does / why we need it: Variance and standard-deviation aggregates accepted DECIMAL256 inputs during planning but panicked at runtime in the aggregate executor. The executor factory now routes DECIMAL256 through the existing numeric variance/stddev state machine while preserving the float64 return type and state/wire layout. Exact decimal-origin deviation handling is retained where representable, with a float64 fallback outside that range. The shared DECIMAL256-to-float64 conversion is also corrected at the signed 128-bit boundary. ## Test plan: - Full `pkg/sql/colexec/aggexec` unit and race tests. - Full `pkg/sql/plan/function` unit tests. - Full `pkg/container/types` unit and race tests. - DECIMAL256 resident, DISTINCT, merge, empty/singleton, serialization, planner, and signed-boundary tests. - `make static-check-analysis GOLANGCI_LINT_CONCURRENCY=1` (`0 issues`). - `git diff --check`. All listed tests passed.
## What type of PR is this? - [x] BUG ## Which issue(s) this PR fixes: issue matrixorigin#28838 ## What this PR does / why we need it: Variance and standard-deviation aggregates accepted DECIMAL256 inputs during planning but panicked at runtime in the aggregate executor. The executor factory now routes DECIMAL256 through the existing numeric variance/stddev state machine while preserving the float64 return type and state/wire layout. Exact decimal-origin deviation handling is retained where representable, with a float64 fallback outside that range. The shared DECIMAL256-to-float64 conversion is also corrected at the signed 128-bit boundary. ## Test plan: - Full `pkg/sql/colexec/aggexec` unit and race tests. - Full `pkg/sql/plan/function` unit tests. - Full `pkg/container/types` unit and race tests. - DECIMAL256 resident, DISTINCT, merge, empty/singleton, serialization, planner, and signed-boundary tests. - `make static-check-analysis GOLANGCI_LINT_CONCURRENCY=1` (`0 issues`). - `git diff --check`. All listed tests passed.
What type of PR is this?
Which issue(s) this PR fixes:
issue #28838
What this PR does / why we need it:
Variance and standard-deviation aggregates accepted DECIMAL256 inputs during planning but panicked at runtime in the aggregate executor.
The executor factory now routes DECIMAL256 through the existing numeric variance/stddev state machine while preserving the float64 return type and state/wire layout. Exact decimal-origin deviation handling is retained where representable, with a float64 fallback outside that range. The shared DECIMAL256-to-float64 conversion is also corrected at the signed 128-bit boundary.
Test plan:
pkg/sql/colexec/aggexecunit and race tests.pkg/sql/plan/functionunit tests.pkg/container/typesunit and race tests.make static-check-analysis GOLANGCI_LINT_CONCURRENCY=1(0 issues).git diff --check.All listed tests passed.