[chore](Nereids) better way to return error (#33507)

This commit is contained in:
morrySnow
2024-04-12 11:37:50 +08:00
committed by yiguolei
parent cea02c4fb6
commit 7bc82cab73

View File

@ -537,7 +537,8 @@ public class StmtExecutor {
if (e instanceof NereidsException && !context.getSessionVariable().enableFallbackToOriginalPlanner
&& !forceFallback) {
LOG.warn("Analyze failed. {}", context.getQueryIdentifier(), e);
throw ((NereidsException) e).getException();
context.getState().setError(e.getMessage());
return;
}
if (LOG.isDebugEnabled()) {
LOG.debug("fall back to legacy planner on statement:\n{}", originStmt.originStmt);