[chore](Nereids) turn on nereids dml when update to 2.1 (#30776)

This commit is contained in:
morrySnow
2024-02-04 10:43:33 +08:00
committed by yiguolei
parent c9ab243153
commit 36b2712709
2 changed files with 24 additions and 0 deletions

View File

@ -1508,6 +1508,10 @@ public class Env {
VariableMgr.enableNereidsPlanner();
LOG.info("upgrade FE from 1.x to 2.x, set enable_nereids_planner to new default value: true");
}
if (journalVersion <= FeMetaVersion.VERSION_123) {
VariableMgr.enableNereidsDml();
LOG.info("upgrade FE from 2.0 to 2.1, set enable_nereids_dml to new default value: true");
}
}
getPolicyMgr().createDefaultStoragePolicy();

View File

@ -435,6 +435,26 @@ public class VariableMgr {
}
}
public static void enableNereidsDml() {
wlock.lock();
try {
VarContext ctx = ctxByVarName.get(SessionVariable.ENABLE_NEREIDS_DML);
try {
setValue(ctx.getObj(), ctx.getField(), String.valueOf(true));
} catch (DdlException e) {
LOG.warn("failed to set global variable: {}", SessionVariable.ENABLE_NEREIDS_DML, e);
return;
}
// write edit log
GlobalVarPersistInfo info = new GlobalVarPersistInfo(defaultSessionVariable,
Lists.newArrayList(SessionVariable.ENABLE_NEREIDS_DML));
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);