yashmayya commented on code in PR #3883:
URL: https://github.com/apache/calcite/pull/3883#discussion_r2057657939


##########
core/src/main/codegen/templates/Parser.jj:
##########
@@ -2092,13 +2096,32 @@ SqlNode JoinTable(SqlNode e) :
     //
     // We allow CROSS JOIN (joinType = CROSS_JOIN) to have a join condition,
     // even though that is not valid SQL; the validator will catch it.
-    LOOKAHEAD(3)
+    LOOKAHEAD(4)
     natural = Natural()
     joinType = JoinType()
     e2 = TableRef1(ExprContext.ACCEPT_QUERY_OR_JOIN)
     (
+        [ <MATCH_CONDITION> matchCondition = 
Expression(ExprContext.ACCEPT_SUB_QUERY) ]
         <ON> { on = JoinConditionType.ON.symbol(getPos()); }

Review Comment:
   @mihaibudiu this means that the `ON` clause is mandatory for `ASOF` joins as 
well, is that intentional? Snowflake's `ASOF JOIN` only requires the 
`MATCH_CONDITION`, with `ON` / `USING` being optional - 
https://docs.snowflake.com/en/sql-reference/constructs/asof-join#syntax.



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

Reply via email to