From aff8d7c0096c9e8da9d37552e40db47a592e6822 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:42:34 +0800 Subject: [PATCH] branch-3.0: [chore](sink) `enable_parallel_result_sink` default value is changed to false #43933 (#44241) Cherry-picked from #43933 Co-authored-by: Xinyi Zou --- .../java/org/apache/doris/qe/SessionVariable.java | 2 +- .../org/apache/doris/utframe/AnotherDemoTest.java | 15 ++++++++++++++- .../java/org/apache/doris/utframe/DemoTest.java | 15 ++++++++++++++- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java index 29c30d87f386b7..f7ff9baf1660c9 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java @@ -1194,7 +1194,7 @@ public enum IgnoreSplitType { private boolean enableSyncRuntimeFilterSize = true; @VariableMgr.VarAttr(name = ENABLE_PARALLEL_RESULT_SINK, needForward = true, fuzzy = true) - private boolean enableParallelResultSink = true; + private boolean enableParallelResultSink = false; @VariableMgr.VarAttr(name = "sort_phase_num", fuzzy = true, needForward = true, description = {"如设置为1,则只生成1阶段sort,设置为2,则只生成2阶段sort,设置其它值,优化器根据代价选择sort类型", diff --git a/fe/fe-core/src/test/java/org/apache/doris/utframe/AnotherDemoTest.java b/fe/fe-core/src/test/java/org/apache/doris/utframe/AnotherDemoTest.java index 2da5a3cabd871e..530fd15a9b6f37 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/utframe/AnotherDemoTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/utframe/AnotherDemoTest.java @@ -25,6 +25,7 @@ import org.apache.doris.catalog.Table; import org.apache.doris.common.DdlException; import org.apache.doris.common.FeConstants; +import org.apache.doris.planner.ExchangeNode; import org.apache.doris.planner.OlapScanNode; import org.apache.doris.planner.PlanFragment; import org.apache.doris.planner.Planner; @@ -120,7 +121,8 @@ public void testCreateDbAndTable() throws Exception { } // 5. query // TODO: we can not process real query for now. So it has to be a explain query - String queryStr = "explain select /*+ SET_VAR(disable_nereids_rules=PRUNE_EMPTY_PARTITION) */ * from db1.tbl1"; + String queryStr = "explain select /*+ SET_VAR(disable_nereids_rules=PRUNE_EMPTY_PARTITION, " + + "enable_parallel_result_sink=true) */ * from db1.tbl1"; StmtExecutor stmtExecutor = new StmtExecutor(ctx, queryStr); stmtExecutor.execute(); Planner planner = stmtExecutor.planner(); @@ -129,5 +131,16 @@ public void testCreateDbAndTable() throws Exception { PlanFragment fragment = fragments.get(0); Assert.assertTrue(fragment.getPlanRoot() instanceof OlapScanNode); Assert.assertEquals(0, fragment.getChildren().size()); + + queryStr = "explain select /*+ SET_VAR(disable_nereids_rules=PRUNE_EMPTY_PARTITION, " + + "enable_parallel_result_sink=false) */ * from db1.tbl1"; + stmtExecutor = new StmtExecutor(ctx, queryStr); + stmtExecutor.execute(); + planner = stmtExecutor.planner(); + fragments = planner.getFragments(); + Assert.assertEquals(2, fragments.size()); + fragment = fragments.get(0); + Assert.assertTrue(fragment.getPlanRoot() instanceof ExchangeNode); + Assert.assertEquals(1, fragment.getChildren().size()); } } diff --git a/fe/fe-core/src/test/java/org/apache/doris/utframe/DemoTest.java b/fe/fe-core/src/test/java/org/apache/doris/utframe/DemoTest.java index 289f6c9902d8f8..f1f9fd7ef23d5c 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/utframe/DemoTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/utframe/DemoTest.java @@ -26,6 +26,7 @@ import org.apache.doris.catalog.OlapTable; import org.apache.doris.catalog.Table; import org.apache.doris.common.FeConstants; +import org.apache.doris.planner.ExchangeNode; import org.apache.doris.planner.OlapScanNode; import org.apache.doris.planner.PlanFragment; import org.apache.doris.planner.Planner; @@ -108,7 +109,8 @@ public void testCreateDbAndTable() throws Exception { // 7. query // TODO: we can not process real query for now. So it has to be a explain query - String queryStr = "explain select /*+ SET_VAR(disable_nereids_rules=PRUNE_EMPTY_PARTITION) */ * from db1.tbl1"; + String queryStr = "explain select /*+ SET_VAR(disable_nereids_rules=PRUNE_EMPTY_PARTITION, " + + "enable_parallel_result_sink=true) */ * from db1.tbl1"; StmtExecutor stmtExecutor = new StmtExecutor(connectContext, queryStr); stmtExecutor.execute(); Planner planner = stmtExecutor.planner(); @@ -117,5 +119,16 @@ public void testCreateDbAndTable() throws Exception { PlanFragment fragment = fragments.get(0); Assertions.assertTrue(fragment.getPlanRoot() instanceof OlapScanNode); Assertions.assertEquals(0, fragment.getChildren().size()); + + queryStr = "explain select /*+ SET_VAR(disable_nereids_rules=PRUNE_EMPTY_PARTITION, " + + "enable_parallel_result_sink=false) */ * from db1.tbl1"; + stmtExecutor = new StmtExecutor(connectContext, queryStr); + stmtExecutor.execute(); + planner = stmtExecutor.planner(); + fragments = planner.getFragments(); + Assertions.assertEquals(2, fragments.size()); + fragment = fragments.get(0); + Assertions.assertTrue(fragment.getPlanRoot() instanceof ExchangeNode); + Assertions.assertEquals(1, fragment.getChildren().size()); } }