This is an automated email from the ASF dual-hosted git repository.
morrysnow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 1883acf2341 [fix](nereids) disable PushDownJoinOtherCondition rule for
mark join (#31084)
1883acf2341 is described below
commit 1883acf2341037d6823a03abfac272ce0a480317
Author: starocean999 <[email protected]>
AuthorDate: Mon Feb 19 17:43:05 2024 +0800
[fix](nereids) disable PushDownJoinOtherCondition rule for mark join
(#31084)
---
.../rules/rewrite/PushDownJoinOtherCondition.java | 3 ++-
.../data/nereids_p0/join/test_mark_join.out | 9 +++++++++
.../suites/nereids_p0/join/test_mark_join.groovy | 19 ++++++++++++++++++-
3 files changed, 29 insertions(+), 2 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushDownJoinOtherCondition.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushDownJoinOtherCondition.java
index 8fff61988d4..cec7413cd61 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushDownJoinOtherCondition.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushDownJoinOtherCondition.java
@@ -62,7 +62,8 @@ public class PushDownJoinOtherCondition extends
OneRewriteRuleFactory {
return logicalJoin()
// TODO: we may need another rule to handle on true or on
false condition
.when(join -> !join.getOtherJoinConjuncts().isEmpty() &&
!(join.getOtherJoinConjuncts().size() == 1
- && join.getOtherJoinConjuncts().get(0) instanceof
BooleanLiteral))
+ && join.getOtherJoinConjuncts().get(0) instanceof
BooleanLiteral)
+ && !join.isMarkJoin())
.then(join -> {
List<Expression> otherJoinConjuncts =
join.getOtherJoinConjuncts();
List<Expression> remainingOther = Lists.newArrayList();
diff --git a/regression-test/data/nereids_p0/join/test_mark_join.out
b/regression-test/data/nereids_p0/join/test_mark_join.out
index 4098502b75d..1ab6bcce40e 100644
--- a/regression-test/data/nereids_p0/join/test_mark_join.out
+++ b/regression-test/data/nereids_p0/join/test_mark_join.out
@@ -41,3 +41,12 @@
3 \N true
4 \N false
+-- !mark_join7 --
+1 p 0
+9 1
+\N \N 2
+\N \N 3
+3 4
+2 q 5
+0 6
+
diff --git a/regression-test/suites/nereids_p0/join/test_mark_join.groovy
b/regression-test/suites/nereids_p0/join/test_mark_join.groovy
index 6008919d831..e951ea15577 100644
--- a/regression-test/suites/nereids_p0/join/test_mark_join.groovy
+++ b/regression-test/suites/nereids_p0/join/test_mark_join.groovy
@@ -21,6 +21,7 @@ suite("test_mark_join", "nereids_p0") {
sql "drop table if exists `test_mark_join_t1`;"
sql "drop table if exists `test_mark_join_t2`;"
+ sql "drop table if exists
table_7_undef_partitions2_keys3_properties4_distributed_by5;"
sql """
CREATE TABLE IF NOT EXISTS `test_mark_join_t1` (
@@ -60,6 +61,16 @@ suite("test_mark_join", "nereids_p0") {
);
"""
+ sql """
+ create table
table_7_undef_partitions2_keys3_properties4_distributed_by5 (
+ col_int_undef_signed int/*agg_type_placeholder*/ ,
+ col_varchar_10__undef_signed varchar(10)/*agg_type_placeholder*/
,
+ pk int/*agg_type_placeholder*/
+ ) engine=olap
+ distributed by hash(pk) buckets 10
+ properties("replication_num" = "1");
+ """
+
sql """
insert into `test_mark_join_t1` values
(1, 1, 1, 'abc', 'efg', 'hjk'),
@@ -80,6 +91,8 @@ suite("test_mark_join", "nereids_p0") {
);
"""
+ sql """insert into
table_7_undef_partitions2_keys3_properties4_distributed_by5(pk,col_int_undef_signed,col_varchar_10__undef_signed)
values
(0,1,'p'),(1,9,''),(2,null,null),(3,null,null),(4,3,''),(5,2,'q'),(6,0,'');"""
+
qt_mark_join1 """
select
k1, k2
@@ -122,5 +135,9 @@ suite("test_mark_join", "nereids_p0") {
from test_mark_join_t1 order by 1, 2, 3;
"""
-
+ qt_mark_join7 """
+ SELECT * FROM
table_7_undef_partitions2_keys3_properties4_distributed_by5 AS t1
+ WHERE EXISTS ( SELECT MIN(`pk`) FROM
table_7_undef_partitions2_keys3_properties4_distributed_by5 AS t2 WHERE t1.pk =
6 )
+ OR EXISTS ( SELECT `pk` FROM
table_7_undef_partitions2_keys3_properties4_distributed_by5 AS t2 WHERE t1.pk =
5 ) order by pk ;
+ """
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]