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

 ##########
 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:
   In the beginning, i add this method to distinguish the `SemiJoin` 
transformed from `Correlate` and `SemiJoin` from `SemiJoinRule` or 
`RelBuilder`. Cause i thought that the join comes from a `Correlate` can make a 
JoinRelType.SEMI join type.
   
   But in current code, Calcite will never transform from Correlate to join 
with `JoinRelType.SEMI`(only left and inner join type), so this method actually 
can simplify to just decide if the join type is `JoinRelType.SEMI`.
   
   But i still keep the variables check and i think correlate should have the 
ability to get a semi join type join.

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


With regards,
Apache Git Services

Reply via email to