[fix](Nereids) not fallback correctly when do forward (#19675)

This commit is contained in:
Zhang Wenxin
2023-05-17 14:22:40 +08:00
committed by GitHub
parent 802e55114b
commit d9950a6422

View File

@ -532,7 +532,14 @@ public class StmtExecutor {
if (parsedStmt != null) {
return;
}
List<StatementBase> statements = new NereidsParser().parseSQL(originStmt.originStmt);
List<StatementBase> statements;
try {
statements = new NereidsParser().parseSQL(originStmt.originStmt);
} catch (Exception e) {
throw new NereidsException(
new AnalysisException("Nereids parse failed. " + e.getMessage(), e)
);
}
if (statements.size() <= originStmt.idx) {
throw new NereidsException(
new AnalysisException("Nereids parse failed. Parser get " + statements.size() + " statements,"