This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 310bde67aba3ba02d47688c4433dc74002f9f4f2
Author: starocean999 <40539150+starocean...@users.noreply.github.com>
AuthorDate: Thu Feb 8 10:49:52 2024 +0800

    [fix](nereids)should not infer predicate for nullaware anti-join (#30924)
---
 .../org/apache/doris/nereids/rules/rewrite/InferPredicates.java   | 1 -
 .../data/correctness_p0/test_null_aware_left_anti_join.out        | 2 ++
 .../filter_push_down/push_down_filter_other_condition.out         | 8 --------
 .../suites/correctness_p0/test_null_aware_left_anti_join.groovy   | 8 ++++++++
 .../filter_push_down/push_down_filter_other_condition.groovy      | 4 ----
 5 files changed, 10 insertions(+), 13 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/InferPredicates.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/InferPredicates.java
index bafbc45cae3..a9153c1ef50 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/InferPredicates.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/InferPredicates.java
@@ -78,7 +78,6 @@ public class InferPredicates extends 
DefaultPlanRewriter<JobContext> implements
                 break;
             case LEFT_OUTER_JOIN:
             case LEFT_ANTI_JOIN:
-            case NULL_AWARE_LEFT_ANTI_JOIN:
                 right = inferNewPredicate(right, expressions);
                 break;
             case RIGHT_OUTER_JOIN:
diff --git 
a/regression-test/data/correctness_p0/test_null_aware_left_anti_join.out 
b/regression-test/data/correctness_p0/test_null_aware_left_anti_join.out
index 09d7d231709..895bd327f34 100644
--- a/regression-test/data/correctness_p0/test_null_aware_left_anti_join.out
+++ b/regression-test/data/correctness_p0/test_null_aware_left_anti_join.out
@@ -16,3 +16,5 @@
 
 -- !semi_emtpy_right --
 
+-- !select_2 --
+
diff --git 
a/regression-test/data/nereids_rules_p0/filter_push_down/push_down_filter_other_condition.out
 
b/regression-test/data/nereids_rules_p0/filter_push_down/push_down_filter_other_condition.out
index affd081e071..8bdbcc730ba 100644
--- 
a/regression-test/data/nereids_rules_p0/filter_push_down/push_down_filter_other_condition.out
+++ 
b/regression-test/data/nereids_rules_p0/filter_push_down/push_down_filter_other_condition.out
@@ -234,14 +234,6 @@ PhysicalResultSink
 ----PhysicalAssertNumRows
 ------PhysicalOlapScan[t2]
 
--- !pushdown_left_anti_join_subquery_outer --
-PhysicalResultSink
---hashJoin[NULL_AWARE_LEFT_ANTI_JOIN] hashCondition=((t1.id = t2.id)) 
otherCondition=()
-----filter((t1.id > 1))
-------PhysicalOlapScan[t1]
-----filter((t2.id > 1))
-------PhysicalOlapScan[t2]
-
 -- !pushdown_cross_join_subquery_outer --
 PhysicalResultSink
 --NestedLoopJoin[CROSS_JOIN]
diff --git 
a/regression-test/suites/correctness_p0/test_null_aware_left_anti_join.groovy 
b/regression-test/suites/correctness_p0/test_null_aware_left_anti_join.groovy
index 6083290b2e5..a414e860f76 100644
--- 
a/regression-test/suites/correctness_p0/test_null_aware_left_anti_join.groovy
+++ 
b/regression-test/suites/correctness_p0/test_null_aware_left_anti_join.groovy
@@ -77,4 +77,12 @@ suite("test_null_aware_left_anti_join") {
             select k1 from ${tableName2} t2 where t2.k1 > 2
         ) order by 1;
     """
+    sql """set enable_nereids_planner=true;"""
+    qt_select_2 """SELECT *
+                    FROM test_null_aware_left_anti_join1 AS t1
+                    WHERE t1.`k1` NOT IN (
+                            SELECT `k1`
+                            FROM test_null_aware_left_anti_join2 AS t2
+                        )
+                        AND t1.`k1` IN (1, 2, 3, 5, 7);"""
 }
diff --git 
a/regression-test/suites/nereids_rules_p0/filter_push_down/push_down_filter_other_condition.groovy
 
b/regression-test/suites/nereids_rules_p0/filter_push_down/push_down_filter_other_condition.groovy
index b08bdac49af..1e539ba8368 100644
--- 
a/regression-test/suites/nereids_rules_p0/filter_push_down/push_down_filter_other_condition.groovy
+++ 
b/regression-test/suites/nereids_rules_p0/filter_push_down/push_down_filter_other_condition.groovy
@@ -143,10 +143,6 @@ suite("push_down_filter_other_condition") {
     qt_pushdown_left_outer_join_subquery_outer"""
     explain shape plan select * from t1 where t1.id = (select id from t2) or 
t1.id is null and t1.id > 1;
     """
-    // Push down join condition to left anti join child outside the subquery
-    qt_pushdown_left_anti_join_subquery_outer"""
-    explain shape plan select * from t1 where t1.id not in (select id from t2) 
and t1.id > 1;
-    """
     // Push down join condition to cross join child outside the subquery
     qt_pushdown_cross_join_subquery_outer"""
     explain shape plan select * from t1 where exists (select 1 from t2) and 
t1.id > 1;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to