Skip to content

fix: return aggregate configuration errors - #28927

Merged
XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
XuPeng-SH:fix/issue-28870-percentile-error
Sep 16, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
XuPeng-SH:fix/issue-28870-percentile-error

Conversation

@XuPeng-SH

Copy link
Copy Markdown
Contributor

Fixes #28870

Root cause: invalid percentile and aggregate configuration paths panicked during physical operator construction, leaking implementation frames to callers.

This patch makes configuration validation error-bearing and performs validation before building child scopes for aggregate, window, and time-window operators. It adds invalid, nonconstant, unsupported-type, expression-error, and legacy configuration controls.

Validation: compile ordinary and race tests; changed-line coverage 46/55 (83.64%); incremental SCA 0 issues.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@matrix-meow matrix-meow added the size/M Denotes a PR that changes [100,499] lines label Sep 15, 2026
@XuPeng-SH
XuPeng-SH force-pushed the fix/issue-28870-percentile-error branch from 285aa0b to 4548ffa Compare September 16, 2026 13:42
@XuPeng-SH

Copy link
Copy Markdown
Contributor Author

Updated head: 4447969883024d5892710e2de56b93a9afdda9b0 (rebased onto main 76e1a9bd9f75480ee76f686c43994f938a15a8d5).

Root cause of the prior Ubuntu/Coverage UT failure was a PR regression: ordered approx_percentile ... DESC was converted to 1-p, although the executor already supports the explicit DESC: configuration and its NaN ordering. The fix restores aggexec.EncodeApproxPercentileConfig(config, descending) and keeps the error-return/early-validation changes.

Focused post-rebase compile/config and DESC/NaN tests pass; changed-package golangci-lint reports 0 issues. The new remote CI run is pending.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep review completed for exact head 4447969883024d5892710e2de56b93a9afdda9b0 (base 76e1a9bd9f75480ee76f686c43994f938a15a8d5).

结论:未发现有充分证据的 P0/P1/P2 blocker,当前实现达到 review 标准。

已核对:

  • aggregate/window/time-window 都在构建 child scope 前执行配置校验,错误直接返回;
  • approx_percentile 保留 EncodeApproxPercentileConfig(config, descending),DESC/ASC、NaN、边界值和 legacy 行为没有发现回归;
  • 临时 vector/resource 有释放,编译失败路径沿现有 scope cleanup 链退出;
  • operator_test.go 的 compile-path 测试覆盖了 aggregate/window/time-window 三条真实入口,不只是 helper;
  • 当前 head 的 CI:required、SCA、UT、coverage、build 和 pessimistic multi-CN BVT 均通过;Upgrade CI skipped。

Non-blocking follow-ups:

  • constructAggregateConfig 的 legacy wrapper 仍会 panic;目前合法 SQL 路径会先经过 validateAggregateConfigs,未发现可绕过预校验的具体路径。
  • TestConstructAggregateConfigPropagatesConfigExpressionErrors 当前 invalid expression 先被 constant-check 拒绝,尚未单独证明 executor 求值错误的传播;可后续补一条真正触发求值错误的用例。

@XuPeng-SH
XuPeng-SH merged commit 8e90e41 into matrixorigin:main Sep 16, 2026
2 of 5 checks passed
@XuPeng-SH
XuPeng-SH deleted the fix/issue-28870-percentile-error branch September 16, 2026 19:49
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
Fixes matrixorigin#28870

Root cause: invalid percentile and aggregate configuration paths
panicked during physical operator construction, leaking implementation
frames to callers.

This patch makes configuration validation error-bearing and performs
validation before building child scopes for aggregate, window, and
time-window operators. It adds invalid, nonconstant, unsupported-type,
expression-error, and legacy configuration controls.

Validation: compile ordinary and race tests; changed-line coverage 46/55
(83.64%); incremental SCA 0 issues.
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
Fixes matrixorigin#28870

Root cause: invalid percentile and aggregate configuration paths
panicked during physical operator construction, leaking implementation
frames to callers.

This patch makes configuration validation error-bearing and performs
validation before building child scopes for aggregate, window, and
time-window operators. It adds invalid, nonconstant, unsupported-type,
expression-error, and legacy configuration controls.

Validation: compile ordinary and race tests; changed-line coverage 46/55
(83.64%); incremental SCA 0 issues.

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: invalid percentile parameters expose compile stack traces to SQL clients

2 participants