[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:
@ -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());
|
||||
|
||||
Reference in New Issue
Block a user