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 db306a51b3 [fix](nereids) missing return value of
resetLogicalProperties() (#23850)
db306a51b3 is described below
commit db306a51b387bdddd06b28a16847cc37a34ff418
Author: starocean999 <[email protected]>
AuthorDate: Mon Sep 4 17:37:26 2023 +0800
[fix](nereids) missing return value of resetLogicalProperties() (#23850)
physicalPlan.resetLogicalProperties(); will not change the origin plan but
create a new plan with no logical property. So should update the plan using
resetLogicalProperties()'s return value.
---
.../post/RecomputeLogicalPropertiesProcessor.java | 2 +-
.../data/nereids_syntax_p0/join_order.out | 3 +
.../suites/nereids_syntax_p0/join_order.groovy | 69 ++++++++++++++++++++++
3 files changed, 73 insertions(+), 1 deletion(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/RecomputeLogicalPropertiesProcessor.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/RecomputeLogicalPropertiesProcessor.java
index 59f2ffdb2d..c676812ef3 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/RecomputeLogicalPropertiesProcessor.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/RecomputeLogicalPropertiesProcessor.java
@@ -29,7 +29,7 @@ public class RecomputeLogicalPropertiesProcessor extends
PlanPostProcessor {
@Override
public Plan visit(Plan plan, CascadesContext ctx) {
PhysicalPlan physicalPlan = (PhysicalPlan) visitChildren(this, plan,
ctx);
- physicalPlan.resetLogicalProperties();
+ physicalPlan = physicalPlan.resetLogicalProperties();
physicalPlan.setMutableState(MutableState.KEY_GROUP,
plan.getGroupIdAsString());
return physicalPlan;
}
diff --git a/regression-test/data/nereids_syntax_p0/join_order.out
b/regression-test/data/nereids_syntax_p0/join_order.out
index b60a65aa0b..5176628bce 100644
--- a/regression-test/data/nereids_syntax_p0/join_order.out
+++ b/regression-test/data/nereids_syntax_p0/join_order.out
@@ -5,3 +5,6 @@
-- !sql2 --
1 1
+-- !select1 --
+1
+
diff --git a/regression-test/suites/nereids_syntax_p0/join_order.groovy
b/regression-test/suites/nereids_syntax_p0/join_order.groovy
index 74f4d7c801..c05bb8d8d2 100644
--- a/regression-test/suites/nereids_syntax_p0/join_order.groovy
+++ b/regression-test/suites/nereids_syntax_p0/join_order.groovy
@@ -115,4 +115,73 @@ suite("join_order") {
FROM outerjoin_B_order AS ref_1
INNER JOIN outerjoin_A_order AS ref_7
ON (true) order by ref_7.a2) AS subq_0 order by 1,
2;"""
+
+ sql """drop table if exists test_table_t1;"""
+ sql """drop table if exists test_table_t2;"""
+ sql """drop table if exists test_table_t3;"""
+
+ sql """ create table test_table_t1
+ (k1 bigint, k2 bigint)
+ ENGINE=OLAP
+ DUPLICATE KEY(k1, k2)
+ COMMENT 'OLAP'
+ DISTRIBUTED BY HASH(k2) BUCKETS 1
+ PROPERTIES (
+ "replication_allocation" = "tag.location.default: 1",
+ "is_being_synced" = "false",
+ "storage_format" = "V2",
+ "light_schema_change" = "true",
+ "disable_auto_compaction" = "false",
+ "enable_single_replica_compaction" = "false"
+ );"""
+
+ sql """ create table test_table_t2
+ (k1 int not null, k2 varchar(128), k3 bigint, v1 bigint,
v2 bigint)
+ ENGINE=OLAP
+ DUPLICATE KEY(k1, k2)
+ COMMENT 'OLAP'
+ DISTRIBUTED BY HASH(k2) BUCKETS 1
+ PROPERTIES (
+ "replication_allocation" = "tag.location.default: 1",
+ "is_being_synced" = "false",
+ "storage_format" = "V2",
+ "light_schema_change" = "true",
+ "disable_auto_compaction" = "false",
+ "enable_single_replica_compaction" = "false"
+ );"""
+
+ sql """ create table test_table_t3
+ (k1 bigint, k2 bigint)
+ ENGINE=OLAP
+ DUPLICATE KEY(k1, k2)
+ COMMENT 'OLAP'
+ DISTRIBUTED BY HASH(k2) BUCKETS 1
+ PROPERTIES (
+ "replication_allocation" = "tag.location.default: 1",
+ "is_being_synced" = "false",
+ "storage_format" = "V2",
+ "light_schema_change" = "true",
+ "disable_auto_compaction" = "false",
+ "enable_single_replica_compaction" = "false"
+ );"""
+
+ sql """insert into test_table_t1 values (1,null);"""
+ sql """insert into test_table_t2 values (1,'abc',2,3,4);"""
+ sql """insert into test_table_t3 values (1,null),(1,4), (1,2), (2,3),
(2,4), (3,7), (3,9),(null,null);"""
+
+ qt_select1 """SELECT
+ count(
+ (SELECT max(`k1`)
+ FROM test_table_t3) )
+ OVER (partition by ref_560.`k2`
+ ORDER BY ref_560.`k1`) AS c3
+ FROM test_table_t1 AS ref_559
+ RIGHT JOIN test_table_t2 AS ref_560
+ ON (ref_560.`k1` = ref_559.`k1` )
+ WHERE ref_559.`k2` is null;
+ """
+
+ sql """drop table if exists test_table_t1;"""
+ sql """drop table if exists test_table_t2;"""
+ sql """drop table if exists test_table_t3;"""
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]