github-actions[bot] commented on code in PR #69485:
URL: https://github.com/apache/doris/pull/69485#discussion_r4354966931
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalCatalog.java:
##########
@@ -1303,6 +1305,24 @@ public void dropTable(String dbName, String tableName,
boolean isView, boolean i
}
throw new DdlException("Failed to get table: '" + tableName + "'
in database: " + dbName);
}
+ // The metadata API receives no kind/lifetime flags and may purge an
ordinary table.
+ // External catalogs have no temporary tables or MTMVs; reject
mismatches before dispatch.
+ if (mustTemporary) {
+ if (ifExists) {
+ return;
+ }
+ ErrorReport.reportDdlException(ErrorCode.ERR_UNKNOWN_TABLE,
tableName, dbName);
+ }
+ if (isMtmv) {
+ ErrorReport.reportDdlException(ErrorCode.ERR_WRONG_OBJECT, dbName,
tableName, "MTMV",
+ "External catalogs do not support materialized views");
+ }
+ boolean actualIsView = dorisTable.isView();
Review Comment:
[P2] Check the object kind without requiring a readable HMS table
This shared dispatch also handles HMS catalogs, where
`HMSExternalTable.isView()` calls `makeSureInitialized()` and
`supportedHiveTable()`. For an ordinary nontransactional Hive table stored as
SequenceFile (or Avro), that initialization throws `NotSupportedException`
because its input format is not supported for scanning. Consequently, a
matching `DROP TABLE hms.db.t` (including `IF EXISTS`) now fails here before
`HiveMetadataOps.dropTableImpl` can delete the table; previously that path only
required existence and a nontransactional table. Resolve the table/view kind
from lightweight remote metadata without validating scan support, and add a
dispatch test using a real HMS table with an unsupported input format. The
current tests mock `isView()`, so they miss this regression.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]