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_r262377232
 
 

 ##########
 File path: core/src/main/codegen/templates/Parser.jj
 ##########
 @@ -5300,6 +5302,30 @@ SqlCall JsonDepthFunctionCall() :
     }
 }
 
+SqlCall JsonLengthFunctionCall() :
+{
+    final SqlNode[] args = new SqlNode[1];
+    SqlNode e;
+    final Span span;
+    List<SqlNode> behavior;
+}
+{
+    <JSON_LENGTH> { span = span(); }
+    <LPAREN> [
 
 Review comment:
   The following code seems not to implement the syntax `JSON_LENGTH(json_doc[, 
path])`. Because basically the production `JsonApiCommonSyntax()` accepts input 
`json_doc, path`, where `JsonValueExpression(true)` accepts `json_doc`. Either 
of them does not suit the parameter syntax of JSON_LENGTH.
   And you may want to add a test to test against the case 
`JSON_LENGTH(json_doc)`, to see if the parser logic is good.

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