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


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergMetadataOps.java:
##########
@@ -387,14 +435,15 @@ public boolean performCreateTable(CreateTableInfo 
createTableInfo) throws UserEx
                 schema);
         // Build and create table with optional sort order
         org.apache.iceberg.SortOrder sortOrder = 
buildSortOrder(createTableInfo.getSortOrderFields(), schema);
+        Catalog activeCatalog = catalog(ctx);
         if (sortOrder != null && !sortOrder.isUnsorted()) {
-            catalog.buildTable(getTableIdentifier(dbName, tableName), schema)
+            activeCatalog.buildTable(getTableIdentifier(dbName, tableName), 
schema)

Review Comment:
   In the session-aware path `db` has already resolved the Doris-local name to 
the remote Iceberg namespace: for example, `getDbNullableWithoutCache()` can 
return local `salesdb` backed by remote `SalesDB`. The existence check uses 
`db.getRemoteName()`, but the create still builds the Iceberg identifier from 
`dbName`, which is the local name from the SQL. With 
`lower_case_database_names=1`, `CREATE TABLE rest_cat.salesdb.t` checks 
`SalesDB.t` and then tries to create `salesdb.t` on the delegated catalog, 
which either fails with namespace-not-found or creates beside the intended 
namespace. `renameTableImpl()` has the same shape after switching to 
`catalog(sessionContext)`. Please build the remote Iceberg identifiers from the 
resolved `ExternalDatabase.getRemoteName()` for the remote mutation, and keep 
the local name only for Doris metadata/edit logs.



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