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


##########
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -3774,11 +3780,130 @@ protected void validateJoin(SqlJoin join, 
SqlValidatorScope scope) {
             RESOURCE.crossJoinDisallowsCondition());
       }
       break;
+    case LEFT_ASOF:
+    case ASOF: {
+      // In addition to the standard join checks, the ASOF join requires the
+      // ON conditions to be a conjunction of simple equalities from both 
relations.
+      SqlAsofJoin asof = (SqlAsofJoin) join;
+      SqlNode matchCondition = getMatchCondition(asof);
+      matchCondition = expand(matchCondition, joinScope);
+      join.setOperand(6, matchCondition);
+      validateWhereOrOn(joinScope, matchCondition, "MATCH_CONDITION");
+      ConjunctionOfEqualities conj = new ConjunctionOfEqualities();

Review Comment:
   Of course, this is a rare case



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