danny0405 commented on a change in pull request #1761:
URL: https://github.com/apache/calcite/pull/1761#discussion_r411872860



##########
File path: core/src/main/codegen/templates/Parser.jj
##########
@@ -6065,10 +6065,22 @@ SqlCall GroupByWindowingCall():
     final List<SqlNode> args;
 }
 {
-    <TUMBLE> { s = span(); }
-    args = UnquantifiedFunctionParameterList(ExprContext.ACCEPT_SUB_QUERY) {
-        return SqlStdOperatorTable.TUMBLE.createCall(s.end(this), args);
-    }
+    (
+        <TUMBLE> { s = span(); }
+        args = UnquantifiedFunctionParameterList(ExprContext.ACCEPT_SUB_QUERY) 
{
+            return SqlStdOperatorTable.TUMBLE.createCall(s.end(this), args);
+        }
+    |
+        <HOP> { s = span(); }
+        args = UnquantifiedFunctionParameterList(ExprContext.ACCEPT_SUB_QUERY) 
{
+            return SqlStdOperatorTable.HOP.createCall(s.end(this), args);
+        }
+    |
+        <SESSION> { s = span(); }
+        args = UnquantifiedFunctionParameterList(ExprContext.ACCEPT_SUB_QUERY) 
{
+            return SqlStdOperatorTable.SESSION.createCall(s.end(this), args);
+        }

Review comment:
       We can combine these
   ```java
   args = UnquantifiedFunctionParameterList(ExprContext.ACCEPT_SUB_QUERY) {
               return SqlStdOperatorTable.SESSION.createCall(s.end(this), args);
           }
   ```
   Use another variable to keep the operator and move the common parse logic to 
the java code block.




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


Reply via email to