From 87149f0f4ea3aa38a3bb5a402bab436abfeb0c4c Mon Sep 17 00:00:00 2001 From: englefly Date: Thu, 21 Sep 2023 18:18:06 +0800 Subject: [PATCH] fix --- .../apache/doris/planner/QueryPlanTest.java | 2 +- .../test_runtimefilter_with_window.groovy | 42 +++++++++++++++++-- 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java b/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java index c6768ab42d5ae8..8bdfb2a1c7ceb0 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java @@ -63,7 +63,7 @@ public class QueryPlanTest extends TestWithFeService { protected void runBeforeAll() throws Exception { // disable bucket shuffle join Deencapsulation.setField(connectContext.getSessionVariable(), "enableBucketShuffleJoin", false); - + connectContext.getSessionVariable().setEnableRuntimeFilterPrune(false); // create database createDatabase("test"); connectContext.getSessionVariable().setEnableNereidsPlanner(false); diff --git a/regression-test/suites/correctness_p0/test_runtimefilter_with_window.groovy b/regression-test/suites/correctness_p0/test_runtimefilter_with_window.groovy index 00ec88b20fc07b..b876ab3de06c5e 100644 --- a/regression-test/suites/correctness_p0/test_runtimefilter_with_window.groovy +++ b/regression-test/suites/correctness_p0/test_runtimefilter_with_window.groovy @@ -16,7 +16,8 @@ // under the License. suite("test_runtimefilter_with_window") { - sql """ set enable_nereids_planner=false""" + sql """ set enable_nereids_planner=true""" + sql """ set disable_join_reorder=true""" sql """ DROP TABLE IF EXISTS `test_runtimefilter_with_window_table1` """ sql """ DROP TABLE IF EXISTS `test_runtimefilter_with_window_table2` """ sql """ @@ -82,9 +83,42 @@ suite("test_runtimefilter_with_window") { on a.channel_param = b.param; """) contains "runtime filters" } - - sql """ DROP TABLE IF EXISTS `test_runtimefilter_with_window_table1` """ - sql """ DROP TABLE IF EXISTS `test_runtimefilter_with_window_table2` """ + sql """ set enable_nereids_planner=false""" + sql """ set disable_join_reorder=true""" + sql """ set enable_runtime_filter_prune=false""" + log.info("======origin planner1=================") + explain { + sql("""select a.phone + ,a.channel_param + ,a.createtime + ,rn + ,if(rn = 1,1,0) as liuzi_status + from ( + select a.phone,a.channel_param,a.createtime + ,row_number() over(partition by phone order by createtime asc) as rn + from test_runtimefilter_with_window_table2 a + ) a join ( + select param + from test_runtimefilter_with_window_table1 + ) b + on a.channel_param = b.param; """) + notContains "runtime filters" + } +log.info("======origin planner2=================") + explain { + sql("""select a.phone + ,a.channel_param + ,a.createtime + from ( + select a.phone,a.channel_param,a.createtime + from test_runtimefilter_with_window_table2 a + ) a join ( + select param + from test_runtimefilter_with_window_table1 + ) b + on a.channel_param = b.param; """) + contains "runtime filters" + } }