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


##########
fe/fe-connector/fe-connector-iceberg/src/main/java/org/apache/doris/connector/iceberg/IcebergConnectorMetadata.java:
##########
@@ -455,26 +469,52 @@ private String loadTableComment(ConnectorSession session, 
String dbName, String
     @Override
     public Optional<ConnectorTableHandle> getTableHandle(
             ConnectorSession session, String dbName, String tableName) {
+        IcebergTableHandle handle = new IcebergTableHandle(dbName, tableName);
+        if (IcebergStatementScope.hasReadTable(session, dbName, tableName)
+                || (tableCache != null && 
tableCache.contains(TableIdentifier.of(dbName, tableName)))) {
+            return Optional.of(handle);
+        }
+        // Offline callers cannot retain a cache lease. Pure existence checks 
use tableExists instead.
+        if (session == null || session.getStatementScope() == 
ConnectorStatementScope.NONE) {
+            return tableExists(session, dbName, tableName) ? 
Optional.of(handle) : Optional.empty();
+        }
+        try {
+            // Loading proves existence and pins the same metadata used by 
schema/snapshot/scan planning.
+            // Borrow through the existing generation-aware cache so 
concurrent cold readers share one load.
+            executeAuthenticated(() -> resolveTableForRead(session, handle));

Review Comment:
   [P2] Keep DROP handle lookup independent of scan planning
   
   For an existing REST Iceberg table whose load response sets 
`scan-planning-mode=server`, run `DROP TABLE` from a normal SQL session with a 
cold or disabled table cache. `PluginDrivenExternalCatalog.dropTable` still 
calls `getTableHandle` after its live `tableExists` preflight, so this new load 
enters `resolveTableForRead` and throws from 
`IcebergScanPlanning.rejectServerSideScanPlanning` before `metadata.dropTable` 
can run. The real RESTTable shape is covered by `IcebergRestScanPlanningTest`. 
Previously this lookup only checked existence, and the REST DROP implementation 
only needs the table identifier. Preserve a DDL handle path that does not 
require local scan support while retaining frozen metadata acquisition for 
query reads. This differs from the existing DROP IF EXISTS thread: the table 
exists and the live preflight succeeds here.



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