caiconghui commented on a change in pull request #3775: URL: https://github.com/apache/incubator-doris/pull/3775#discussion_r531468856
########## File path: fe/fe-core/src/main/java/org/apache/doris/alter/Alter.java ########## @@ -128,30 +124,10 @@ public void processDropMaterializedView(DropMaterializedViewStmt stmt) throws Dd ErrorReport.reportDdlException(ErrorCode.ERR_BAD_DB_ERROR, dbName); } - db.writeLock(); - try { - String tableName = stmt.getTableName().getTbl(); - Table table = db.getTable(tableName); - // if table exists - if (table == null) { - ErrorReport.reportDdlException(ErrorCode.ERR_BAD_TABLE_ERROR, tableName); - } - // check table type - if (table.getType() != TableType.OLAP) { - throw new DdlException("Do not support non-OLAP table [" + tableName + "] when drop materialized view"); - } - // check table state - OlapTable olapTable = (OlapTable) table; - if (olapTable.getState() != OlapTableState.NORMAL) { - throw new DdlException("Table[" + table.getName() + "]'s state is not NORMAL. " - + "Do not allow doing DROP ops"); - } - // drop materialized view - ((MaterializedViewHandler)materializedViewHandler).processDropMaterializedView(stmt, db, olapTable); - - } finally { - db.writeUnlock(); - } + String tableName = stmt.getTableName().getTbl(); + OlapTable olapTable = (OlapTable) db.getTableOrThrowException(tableName, TableType.OLAP); Review comment: processDropMaterializedView has check table state operation ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org