zabetak commented on a change in pull request #1157: [CALCITE-2969] Improve 
design of join-like relational expressions
URL: https://github.com/apache/calcite/pull/1157#discussion_r279153072
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rel/core/Join.java
 ##########
 @@ -230,6 +237,17 @@ public boolean isSemiJoinDone() {
     return false;
   }
 
+  /**
+   * Returns whether this LogicalJoin is a semi-join but does
+   * not comes from decorrelate.
+   *
+   * @return true if this is semi but without correlate variables.
+   */
+  public boolean isNonCorrelateSemiJoin() {
+    return (this.variablesSet == null || this.variablesSet.size() == 0)
+        && joinType == JoinRelType.SEMI;
+  }
 
 Review comment:
   Currently we have two concepts `Join` and `Correlate`. If we say that the 
`Join` can have correlated variables then I don't see why we need to keep 
`Correlate`.  
   The discussion so far (and the current PR) proposes to keep `Correlate` so 
that's why I think that `Join` should not deal with correlated variables.
   
   > Calcite supports converting from a Correlate to Join ...
   
   @danny0405 can you explain a bit more where this is happening? I know that 
the opposite is done with JoinToCorrelateRule but I don't remember seeing 
CorrelateToJoinRule (or something similar). We can certainly add such a rule 
but I argue that in this case we should be able to get rid of correlated 
variables.
   
   
   
   

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to