[chore](Nereids) enable nereids if update from doris 1.x (#30369)
This commit is contained in:
@ -1502,6 +1502,10 @@ public class Env {
|
||||
VariableMgr.setGlobalBroadcastScaleFactor(newBcFactorVal);
|
||||
LOG.info("upgrade FE from 1.x to 2.x, set broadcast_right_table_scale_factor "
|
||||
+ "to new default value: {}", newBcFactorVal);
|
||||
|
||||
// similar reason as above, need to upgrade enable_nereids_planner to true
|
||||
VariableMgr.enableNereidsPlanner();
|
||||
LOG.info("upgrade FE from 1.x to 2.x, set enable_nereids_planner to new default value: true");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -415,6 +415,26 @@ public class VariableMgr {
|
||||
}
|
||||
}
|
||||
|
||||
public static void enableNereidsPlanner() {
|
||||
wlock.lock();
|
||||
try {
|
||||
VarContext ctx = ctxByVarName.get(SessionVariable.ENABLE_NEREIDS_PLANNER);
|
||||
try {
|
||||
setValue(ctx.getObj(), ctx.getField(), String.valueOf(true));
|
||||
} catch (DdlException e) {
|
||||
LOG.warn("failed to set global variable: {}", SessionVariable.ENABLE_NEREIDS_PLANNER, e);
|
||||
return;
|
||||
}
|
||||
|
||||
// write edit log
|
||||
GlobalVarPersistInfo info = new GlobalVarPersistInfo(defaultSessionVariable,
|
||||
Lists.newArrayList(SessionVariable.ENABLE_NEREIDS_PLANNER));
|
||||
Env.getCurrentEnv().getEditLog().logGlobalVariableV2(info);
|
||||
} finally {
|
||||
wlock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public static void setLowerCaseTableNames(int mode) throws DdlException {
|
||||
VarContext ctx = ctxByVarName.get(GlobalVariable.LOWER_CASE_TABLE_NAMES);
|
||||
setGlobalVarAndWriteEditLog(ctx, GlobalVariable.LOWER_CASE_TABLE_NAMES, "" + mode);
|
||||
|
||||
Reference in New Issue
Block a user