You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "swuferhong (via GitHub)" <gi...@apache.org> on 2023/03/14 01:36:34 UTC

[GitHub] [flink] swuferhong commented on a diff in pull request #22049: [FLINK-31273][table-planner] Fix left join with IS_NULL filter be wrongly pushed down and get wrong join results

swuferhong commented on code in PR #22049:
URL: https://github.com/apache/flink/pull/22049#discussion_r1134791918


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/rules/logical/FlinkFilterJoinRule.java:
##########
@@ -386,6 +387,21 @@ private void pushFiltersToAnotherSide(
         }
     }
 
+    private boolean isSuitableFilterToPush(RexNode filter, JoinRelType joinType) {
+        if (filter.isAlwaysTrue()) {
+            return false;
+        }
+        // For left/right outer join, we cannot push down IS_NULL filter to other side. Take left
+        // outer join as an example, If the join right side contains an IS_NULL filter, while we try
+        // to push it to the join left side and the left side have any other filter on this column,
+        // which will conflict and generate wrong plan.
+        if ((joinType == JoinRelType.LEFT || joinType == JoinRelType.RIGHT)

Review Comment:
   Hi, @herunkang2018. For method FlinkFilterJoinRule#pushFiltersToAnotherSide, we only support Inner/left/Right join. So there is no need to judge the full outer join here.



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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org