[Coral-Hive] Add missing Hive multi-dimensional aggregation functions: GROUPING_SE…#517
Open
JiaLiangC wants to merge 1 commit intolinkedin:masterfrom
Open
[Coral-Hive] Add missing Hive multi-dimensional aggregation functions: GROUPING_SE…#517JiaLiangC wants to merge 1 commit intolinkedin:masterfrom
JiaLiangC wants to merge 1 commit intolinkedin:masterfrom
Conversation
…TS, ROLLUP, and CUBE
Author
|
@wmoustafa Could you help review it? |
wmoustafa
reviewed
Jul 16, 2024
|
|
||
| import static com.google.common.base.Preconditions.checkState; | ||
| import static java.lang.String.format; | ||
| import static org.apache.calcite.sql.fun.SqlStdOperatorTable.*; |
Contributor
There was a problem hiding this comment.
Let us remove this for consistency with the rest of the file.
|
|
||
| @Override | ||
| protected SqlNode visitGroupingSets(ASTNode node, ParseContext ctx){ | ||
| // When Hive recognizes a grouping set, it omits the group by node in the constructed AST. |
Contributor
There was a problem hiding this comment.
Nit: GROUP BY for readability here and the rest of the comments.
| @Override | ||
| protected SqlNode visitGroupingSets(ASTNode node, ParseContext ctx){ | ||
| // When Hive recognizes a grouping set, it omits the group by node in the constructed AST. | ||
| // However, Calcite requires the grouping set to be within a group by node when building SqlNode. |
Contributor
There was a problem hiding this comment.
This comment is not very clear. You might depict the structure of the two trees using an example.
Comment on lines
+534
to
+536
| if(ctx.grpBy == null){ | ||
| ctx.grpBy = new SqlNodeList(new ArrayList<SqlNode>(), ZERO); | ||
| } |
Contributor
There was a problem hiding this comment.
Could you add a similar comment on the relationship between the two representations? Here and in RollUp.
Contributor
|
Thanks for the PR. I think it still needs some more work: 1- Conversion from SqlNode to RelNode. |
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.
…TS, ROLLUP, and CUBE
What changes are proposed in this pull request, and why are they necessary?
Add missing Hive multidimensional aggregation functions (GROUPING SETS, CUBE, ROLLUP) to the coral-hive module.
How was this patch tested?
tested by run unit test