Support GROUP BY ALL in relational queries#17380
Open
Eliaaazzz wants to merge 1 commit intoapache:masterfrom
Open
Support GROUP BY ALL in relational queries#17380Eliaaazzz wants to merge 1 commit intoapache:masterfrom
Eliaaazzz wants to merge 1 commit intoapache:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #17337
Description
This PR adds support for
GROUP BY ALLin Table Model relational queries.GROUP BY ALLinfers grouping keys from non-aggregate and non-window expressions in theSELECTlist, which improves query ergonomics and reduces duplicated grouping expressions in common aggregation queries.This PR also keeps
date_bin_gapfill(...)behavior consistent underGROUP BY ALL, including existing validation for multiple gapfill expressions.This PR has:
Key changed/added classes (or packages if there are too many classes) in this PR
iotdb-core/relational-grammar/src/main/antlr4/org/apache/iotdb/db/relational/grammar/sql/RelationalSql.g4iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/parser/AstBuilder.javaiotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/GroupBy.javaiotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/StatementAnalyzer.javaiotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/util/SqlFormatter.javaiotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/GroupByAllTest.javaTested with:
./mvnw.cmd -pl iotdb-core/datanode -Dtest=GroupByAllTest test