[opt](Nereids) use enable_nereids_dml to control ctas and create table (#29284)

This commit is contained in:
morrySnow
2023-12-29 20:47:22 +08:00
committed by GitHub
parent 07bd65abe0
commit fcb90dc808

View File

@ -73,6 +73,14 @@ public class CreateTableCommand extends Command implements ForwardWithSync {
@Override
public void run(ConnectContext ctx, StmtExecutor executor) throws Exception {
if (!ctx.getSessionVariable().isEnableNereidsDML()) {
try {
ctx.getSessionVariable().enableFallbackToOriginalPlannerOnce();
} catch (Exception e) {
throw new AnalysisException("failed to set fallback to original planner to true", e);
}
throw new AnalysisException("Nereids DML is disabled, will try to fall back to the original planner");
}
if (!ctasQuery.isPresent()) {
createTableInfo.validate(ctx);
CreateTableStmt createTableStmt = createTableInfo.translateToLegacyStmt();