jcamachor commented on a change in pull request #2349:
URL: https://github.com/apache/calcite/pull/2349#discussion_r579373706



##########
File path: core/src/main/java/org/apache/calcite/rel/core/JoinRelType.java
##########
@@ -152,4 +152,29 @@ public JoinRelType cancelNullsOnRight() {
   public boolean projectsRight() {
     return this != SEMI && this != ANTI;
   }
+
+  /** Returns whether this join type accepts pushing predicates from above 
into its predicate. */
+  public boolean canPushIntoFromAbove() {
+    return (this == INNER) || (this == SEMI);

Review comment:
       I'm thinking about this in terms of the algebra rather than SQL. The 
rule can match a filter on top of ANTI, and you are trying to push those 
expressions from above into the join condition, to the left input as a filter, 
or the right input as a filter. `canPushLeftFromAbove` returns true for ANTI 
indeed as you described. However, `canPushIntoFromAbove` returns false for ANTI 
because it's not semantically equivalent to filter after ANTI and to filter 
within the ANTI. SEMI semantics are different.




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