Skip to content

Commit

Permalink
branch-3.0: [chore](sink) enable_parallel_result_sink default value…
Browse files Browse the repository at this point in the history
… is changed to false #43933 (#44241)

Cherry-picked from #43933

Co-authored-by: Xinyi Zou <[email protected]>
  • Loading branch information
github-actions[bot] and xinyiZzz authored Nov 19, 2024
1 parent eb0054f commit aff8d7c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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类型",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand All @@ -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());
}
}
15 changes: 14 additions & 1 deletion fe/fe-core/src/test/java/org/apache/doris/utframe/DemoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand All @@ -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());
}
}

0 comments on commit aff8d7c

Please sign in to comment.