fix(query): return semantic error for invalid grouping()#19594
fix(query): return semantic error for invalid grouping()#19594sundy-li wants to merge 7 commits intodatabendlabs:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 31daed9aad
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
The current fix is still incomplete for invalid
That means queries like Please extend the validation/rewrite so the non-rewritten clauses are covered as well (at least |
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
GROUPING()query panics during constant folding instead of returning semantic error #19554groupingscalar before aggregate rewriteGROUPING()calls with a semantic error instead of letting them reach the dummy implementationGROUPING()usageTests
Type of change
Validation
cargo test -p databend-query --test it sql::planner::semantic::type_check::test_invalid_grouping_returns_semantic_error -- --exactcargo test -p databend-query --test it sql::planner::semantic::type_check -- --nocapturecargo fmt --all --checkcargo clippy -p databend-common-expression -p databend-common-sql --lib -- -D warningsAdded sqllogictest coverage in
tests/sqllogictests/suites/duckdb/sql/aggregate/group/group_by_grouping_sets.test, but did not run the standalone sqllogictest harness locally.This change is