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_r279187820
########## 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: I agree to remove variables also, as far as i can see, the variables are used when building a Correlate[1], If we see Correlate as (Join + variableSet), remove variableSet from Join may be the more correct way to go. Another thing i see is that the Correlate do not have join condition, which eliminate it's ability. [1]https://github.com/apache/calcite/blob/a3f81bb7b088fd8c1d0c1df3b0f2b0cf122633de/core/src/main/java/org/apache/calcite/tools/RelBuilder.java#L1729 ---------------------------------------------------------------- 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