github-actions[bot] commented on code in PR #68474:
URL: https://github.com/apache/doris/pull/68474#discussion_r4090669230


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/plugin/PluginDrivenExternalCatalog.java:
##########
@@ -800,6 +800,18 @@ public void dropTable(String dbName, String tableName, 
boolean isView, boolean i
             }
             throw new DdlException("Failed to get table: '" + tableName + "' 
in database: " + dbName);
         }
+        // External catalogs have no temporary-table namespace: CREATE 
TEMPORARY TABLE is rejected for
+        // every non-internal catalog, so DROP TEMPORARY TABLE can never name 
a live temporary table
+        // here. getTableNullable above falls back to the permanent table of 
the same name, which must
+        // NOT be dropped. Mirror InternalCatalog: IF EXISTS turns the missing 
temporary table into a
+        // no-op, otherwise report the unknown table instead of silently 
destroying the permanent one.
+        if (mustTemporary) {

Review Comment:
   [P2] Handle `mustTemporary` before resolving the permanent table
   
   For an existing external database with no permanent `tableName`, the null 
check above returns before this block, so `DROP TEMPORARY TABLE 
catalog.db.missing` raises the generic `ERR_UNKNOWN_ERROR` / `Failed to get 
table` instead of the promised `ERR_UNKNOWN_TABLE`; with `IF EXISTS`, the 
categorical no-op still depends on `getTableNullable`, which can synchronously 
list remote tables. External catalogs cannot host temporary tables, so after 
validating that `db` exists the outcome is already known. Please move this 
block above `db.getTableNullable` and add an absent-peer test that checks the 
exact error code and that permanent-table lookup is skipped.



-- 
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]

Reply via email to