-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Coral-Hive] Add missing Hive multi-dimensional aggregation functions: GROUPING_SE… #517
base: master
Are you sure you want to change the base?
Conversation
…TS, ROLLUP, and CUBE
@wmoustafa Could you help review it? |
@@ -63,6 +64,7 @@ | |||
|
|||
import static com.google.common.base.Preconditions.checkState; | |||
import static java.lang.String.format; | |||
import static org.apache.calcite.sql.fun.SqlStdOperatorTable.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is not very clear. You might depict the structure of the two trees using an example.
if(ctx.grpBy == null){ | ||
ctx.grpBy = new SqlNodeList(new ArrayList<SqlNode>(), ZERO); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a similar comment on the relationship between the two representations? Here and in RollUp
.
Thanks for the PR. I think it still needs some more work: 1- Conversion from SqlNode to RelNode. |
…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