[fix](nereids) query cannot execution when both nereids enable and fallback to legacy planner are set to false (#13787)

when enable_nereids_planner=false and enable_fallback_to_origin=false, FE throws exception for all select statement.
Expected: when enable_nereids_planner=false, all valid query execution success
This commit is contained in:
minghong
2022-10-31 19:02:01 +08:00
committed by GitHub
parent ba177a15cb
commit 18be77af64

View File

@ -282,10 +282,11 @@ public class ConnectProcessor {
ctx.resetReturnRows();
}
parsedStmt = stmts.get(i);
if (parsedStmt instanceof SelectStmt) {
if (!ctx.getSessionVariable().enableFallbackToOriginalPlanner) {
throw new Exception(String.format("SQL: %s", parsedStmt.toSql()), nereidsParseException);
}
if (parsedStmt instanceof SelectStmt && nereidsParseException != null
&& ctx.getSessionVariable().isEnableNereidsPlanner()
&& !ctx.getSessionVariable().enableFallbackToOriginalPlanner) {
throw new Exception(String.format("nereids cannot anaylze sql, and fall-back disabled: %s",
parsedStmt.toSql()), nereidsParseException);
}
parsedStmt.setOrigStmt(new OriginStatement(originStmt, i));
parsedStmt.setUserInfo(ctx.getCurrentUserIdentity());