julianhyde 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_r279473653
##########
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:
The reason for variablesSet is correlated scalar sub-query in the ON clause.
Similarly Filter needs variablesSet if there is a correlated scalar sub-query
in its condition, and Project needs variablesSet for correlated scalar
sub-query in one of the project expressions.
This stuff isn't very well tested, but it is needed because sub-query can
occur anywhere in a query.
----------------------------------------------------------------
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