Jibing-Li commented on code in PR #39532: URL: https://github.com/apache/doris/pull/39532#discussion_r1734153678
########## fe/fe-core/src/main/java/org/apache/doris/alter/Alter.java: ########## @@ -453,31 +475,37 @@ private void processModifyEngineInternal(Database db, Table externalTable, public void processAlterTable(AlterTableStmt stmt) throws UserException { TableName dbTableName = stmt.getTbl(); + String ctlName = dbTableName.getCtl(); String dbName = dbTableName.getDb(); String tableName = dbTableName.getTbl(); - Database db = Env.getCurrentInternalCatalog().getDbOrDdlException(dbName); - Table table = db.getTableOrDdlException(tableName); + DatabaseIf dbIf = Env.getCurrentEnv().getCatalogMgr().getCatalog(ctlName).getDbOrDdlException(dbName); + TableIf tableIf = dbIf.getTableOrDdlException(tableName); List<AlterClause> alterClauses = Lists.newArrayList(); // some operations will take long time to process, need to be done outside the table lock boolean needProcessOutsideTableLock = false; - switch (table.getType()) { + switch (tableIf.getType()) { case MATERIALIZED_VIEW: case OLAP: - OlapTable olapTable = (OlapTable) table; - needProcessOutsideTableLock = processAlterOlapTable(stmt, olapTable, alterClauses, db); + OlapTable olapTable = (OlapTable) tableIf; + needProcessOutsideTableLock = processAlterOlapTable(stmt, olapTable, alterClauses, (Database) dbIf); break; case ODBC: case JDBC: case HIVE: case MYSQL: case ELASTICSEARCH: - processAlterExternalTable(stmt, table, db); + processAlterExternalTable(stmt, (Table) tableIf, (Database) dbIf); + return; + case HMS_EXTERNAL_TABLE: + alterClauses.addAll(stmt.getOps()); Review Comment: For now, external table only support one alter table operation, that is modify table property. Also added Precondition check. -- 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. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org 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