From 0ba6619e99c0849e8c9453cb8ba00373a4a9a554 Mon Sep 17 00:00:00 2001 From: minghong Date: Wed, 11 Sep 2024 17:25:39 +0800 Subject: [PATCH] sessionvar --- .../doris/nereids/processor/post/PlanPostProcessors.java | 4 +++- .../src/main/java/org/apache/doris/qe/SessionVariable.java | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/PlanPostProcessors.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/PlanPostProcessors.java index 1d930a4b608613..11a4b73d8a31c5 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/PlanPostProcessors.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/PlanPostProcessors.java @@ -63,7 +63,9 @@ public List getProcessors() { builder.add(new MergeProjectPostProcessor()); builder.add(new RecomputeLogicalPropertiesProcessor()); builder.add(new AddOffsetIntoDistribute()); - builder.add(new ProjectAggregateExpressionsForCse()); + if (cascadesContext.getConnectContext().getSessionVariable().enableAggregateCse) { + builder.add(new ProjectAggregateExpressionsForCse()); + } builder.add(new CommonSubExpressionOpt()); // DO NOT replace PLAN NODE from here if (cascadesContext.getConnectContext().getSessionVariable().pushTopnToAgg) { 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 8db24006293249..8da7fd1d541f35 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 @@ -678,6 +678,9 @@ public class SessionVariable implements Serializable, Writable { @VariableMgr.VarAttr(name = EXPAND_RUNTIME_FILTER_BY_INNER_JION) public boolean expandRuntimeFilterByInnerJoin = true; + @VariableMgr.VarAttr(name = "enable_aggregate_cse", needForward = true) + public boolean enableAggregateCse = true; + @VariableMgr.VarAttr(name = JDBC_CLICKHOUSE_QUERY_FINAL, needForward = true, description = {"是否在查询 ClickHouse JDBC 外部表时,对查询 SQL 添加 FINAL 关键字。", "Whether to add the FINAL keyword to the query SQL when querying ClickHouse JDBC external tables."})