zabetak commented on a change in pull request #1112: [CALCITE-2930]
FilterCorrelateRule on a Correlate with SemiJoinType SEMI (or ANTI) throws
IllegalStateException (Ruben Quesada Lopez)
URL: https://github.com/apache/calcite/pull/1112#discussion_r267218860
##########
File path:
core/src/main/java/org/apache/calcite/rel/rules/FilterCorrelateRule.java
##########
@@ -86,8 +86,10 @@ public void onMatch(RelOptRuleCall call) {
aboveFilters,
JoinRelType.INNER,
false,
- !corr.getJoinType().toJoinType().generatesNullsOnLeft(),
- !corr.getJoinType().toJoinType().generatesNullsOnRight(),
+ corr.getJoinType().returnsJustFirstInput()
+ || !corr.getJoinType().toJoinType().generatesNullsOnLeft(),
+ !corr.getJoinType().returnsJustFirstInput()
Review comment:
Can't this be replaced with `corr.getJoinType()==SemiJoinType.INNER`. The
only time where we can push the filter into the right relation is for
SemiJoinType.INNER. In any other the case the right side either generates nulls
either does not exist.
----------------------------------------------------------------
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