[fix](mtmv) ignore MTMV when backup and restore (#35703)

pick from master #35586​

This is a temporary solution. In order to avoid affecting the existing
backup function, the backup MTMV will be allowed after detailed design
This commit is contained in:
zhangdong
2024-05-31 13:57:24 +08:00
committed by GitHub
parent 14a17fdb41
commit 514e957474
3 changed files with 103 additions and 1 deletions

View File

@ -383,7 +383,8 @@ public class BackupHandler extends MasterDaemon implements Writable {
for (TableRef tblRef : tblRefs) {
String tblName = tblRef.getName().getTbl();
Table tbl = db.getTableOrDdlException(tblName);
if (tbl.getType() == TableType.VIEW || tbl.getType() == TableType.ODBC) {
if (tbl.getType() == TableType.VIEW || tbl.getType() == TableType.ODBC
|| tbl.getType() == TableType.MATERIALIZED_VIEW) {
continue;
}
if (tbl.getType() != TableType.OLAP) {

View File

@ -406,6 +406,8 @@ public class BackupJob extends AbstractJob {
tbl.readLock();
try {
switch (tbl.getType()) {
case MATERIALIZED_VIEW:
break;
case OLAP:
OlapTable olapTable = (OlapTable) tbl;
if (!checkOlapTable(olapTable, tableRef).ok()) {