zhztheplayer commented on a change in pull request #1070: [CALCITE-2808]Add the 
JSON_LENGTH function
URL: https://github.com/apache/calcite/pull/1070#discussion_r265504602
 
 

 ##########
 File path: core/src/main/codegen/templates/Parser.jj
 ##########
 @@ -4927,21 +4929,32 @@ SqlNode JsonPathSpec() :
     }
 }
 
-SqlNode JsonApiCommonSyntax() :
+SqlNode JsonApiCommonSyntax(boolean acceptNonPath) :
 {
     SqlNode e;
     List<SqlNode> args = new ArrayList<SqlNode>();
     Span span;
+    SqlOperator op;
 }
 {
     e = JsonValueExpression(true) {
         args.add(e);
         span = Span.of(e);
     }
-    <COMMA>
-    e = Expression(ExprContext.ACCEPT_NON_QUERY) {
-        args.add(e);
-    }
+    (
+        <COMMA>
+        e = Expression(ExprContext.ACCEPT_NON_QUERY) {
+            op = SqlStdOperatorTable.JSON_API_COMMON_SYNTAX;
+            args.add(e);
+        }
+    |
+        {
+            if (!acceptNonPath) {
+                // throw some error ...
 
 Review comment:
   Let's do some real error throwing rather than just adding the comment.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to