soumyakanti3578 commented on code in PR #6212:
URL: https://github.com/apache/hive/pull/6212#discussion_r2579076838
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ASTConverter.java:
##########
@@ -1000,7 +1001,18 @@ public ASTNode visitOver(RexOver over) {
}
// 1. Translate the UDAF
- final ASTNode wUDAFAst = visitCall(over);
+ ASTNode wUDAFAst = ASTBuilder.createAST(HiveParser.TOK_FUNCTION,
"TOK_FUNCTION");
+ if (over.getOperands().isEmpty() && over.op.getSyntax() ==
SqlSyntax.FUNCTION_STAR) {
+ wUDAFAst = ASTBuilder.createAST(HiveParser.TOK_FUNCTIONSTAR,
"TOK_FUNCTIONSTAR");
+ }
+ if (over.isDistinct()) {
+ wUDAFAst = ASTBuilder.createAST(HiveParser.TOK_FUNCTIONDI,
"TOK_FUNCTIONDI");
+ }
+ wUDAFAst.addChild(ASTBuilder.createAST(HiveParser.Identifier,
over.op.getName()));
+ wUDAFAst.setTypeInfo(TypeConverter.convert(over.type));
+ for (RexNode operand : over.getOperands()) {
+ wUDAFAst.addChild(operand.accept(this));
+ }
Review Comment:
Adding a few lines of comments explaining this part would be nice as it has
changed significantly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]