[feat](nereids) add session var to turn on/off common sub expressoin extraction (branch-2.1) #33616
This commit is contained in:
@ -63,7 +63,9 @@ public class PlanPostProcessors {
|
||||
builder.add(new MergeProjectPostProcessor());
|
||||
builder.add(new RecomputeLogicalPropertiesProcessor());
|
||||
builder.add(new AddOffsetIntoDistribute());
|
||||
builder.add(new CommonSubExpressionOpt());
|
||||
if (cascadesContext.getConnectContext().getSessionVariable().enableCommonSubExpression) {
|
||||
builder.add(new CommonSubExpressionOpt());
|
||||
}
|
||||
// DO NOT replace PLAN NODE from here
|
||||
builder.add(new TopNScanOpt());
|
||||
builder.add(new FragmentProcessor());
|
||||
|
||||
@ -908,6 +908,10 @@ public class SessionVariable implements Serializable, Writable {
|
||||
varType = VariableAnnotation.EXPERIMENTAL, needForward = true)
|
||||
private int parallelScanMaxScannersCount = 48;
|
||||
|
||||
@VariableMgr.VarAttr(name = "enable_common_sub_expression", fuzzy = false,
|
||||
varType = VariableAnnotation.EXPERIMENTAL, needForward = true)
|
||||
public boolean enableCommonSubExpression = false;
|
||||
|
||||
@VariableMgr.VarAttr(name = PARALLEL_SCAN_MIN_ROWS_PER_SCANNER, fuzzy = true,
|
||||
varType = VariableAnnotation.EXPERIMENTAL, needForward = true)
|
||||
private long parallelScanMinRowsPerScanner = 16384; // 16K
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
// and modified by Doris.
|
||||
|
||||
suite('cse') {
|
||||
sql "set enable_common_sub_expression=true"
|
||||
def q1 = """select s_suppkey,n_regionkey,(s_suppkey + n_regionkey) + 1 as x, (s_suppkey + n_regionkey) + 2 as y
|
||||
from supplier join nation on s_nationkey=n_nationkey order by s_suppkey , n_regionkey limit 10 ;
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user