xinyiZzz commented on code in PR #30817:
URL: https://github.com/apache/doris/pull/30817#discussion_r1478498210


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java:
##########
@@ -3250,7 +3252,17 @@ public Object visitCallProcedure(CallProcedureContext 
ctx) {
         List<Expression> arguments = ctx.expression().stream()
                 .<Expression>map(this::typedVisit)
                 .collect(ImmutableList.toImmutableList());
-        UnboundFunction unboundFunction = new UnboundFunction(functionName, 
arguments);
+        UnboundFunction unboundFunction = new UnboundFunction(functionName, 
arguments, getOriginSql(ctx));

Review Comment:
   `Procedure`, `Function`, `Package` have very similar syntax, the difference 
is that `Function` has `Return`, etc.
   
   In Hive, `Procedure` and `Function` share the same set of `FunctionRegistry` 
interfaces.
   In Oracle, their syntax is also very similar.
   
   ————————————————————————
   Of course, now for fewer code changes
   The code structure between `Procedure`, `Function`, `built-in Function`, and 
`Package` will be further considered later.
   
   TODO have been added



##########
fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4:
##########
@@ -34,6 +34,12 @@ singleStatement
     ;
 
 statement
+    : statementBase # statementBaseAlias
+    | CALL functionName=identifier LEFT_PAREN (expression (COMMA 
expression)*)? RIGHT_PAREN #callProcedure
+    | (ALTER | CREATE (OR REPLACE)? | REPLACE)? (PROCEDURE | PROC) identifier 
LEFT_PAREN .*? RIGHT_PAREN .*? #createProcedure

Review Comment:
   In Oracle, create procedure must have `AS` or `IS` after `RIGHT_PAREN`,
   but Mysql and Hive not support `AS` or `IS`.
   
   Compatibility issues with Oracle will be discussed and resolved later, but 
this PR is not yet the final version.
   
   TODO have been added



-- 
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]

Reply via email to