branch-2.1: [Bug](materialized-view) Fixed the problem of using drop table force and create mv stmt at the… #41580 (#50133)

Cherry-picked from #41580

Co-authored-by: Pxl <pxl290@qq.com>
This commit is contained in:
github-actions[bot]
2025-04-18 11:30:47 +08:00
committed by GitHub
parent c3a201dcbf
commit 77ea907b54
2 changed files with 57 additions and 1 deletions

View File

@ -886,7 +886,11 @@ public class RollupJobV2 extends AlterJobV2 implements GsonPostProcessable {
stmt.analyze(analyzer);
} catch (Exception e) {
// Under normal circumstances, the stmt will not fail to analyze.
throw new IOException("error happens when parsing create materialized view stmt: " + stmt, e);
// In some cases (such as drop table force), analyze may fail because cancel is
// not included in the checkpoint.
jobState = JobState.CANCELLED;
LOG.warn("error happens when parsing create materialized view stmt: " + stmt, e);
return;
}
setColumnsDefineExpr(stmt.getMVColumnItemList());
}