github-actions[bot] commented on code in PR #63068:
URL: https://github.com/apache/doris/pull/63068#discussion_r3543048196
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergMetadataOps.java:
##########
@@ -332,14 +376,18 @@ public boolean createTableImpl(CreateTableInfo
createTableInfo) throws UserExcep
}
public boolean performCreateTable(CreateTableInfo createTableInfo) throws
UserException {
+ return performCreateTable(SessionContext.current(), createTableInfo);
+ }
+
+ private boolean performCreateTable(SessionContext ctx, CreateTableInfo
createTableInfo) throws UserException {
String dbName = createTableInfo.getDbName();
ExternalDatabase<?> db = dorisCatalog.getDbNullable(dbName);
if (db == null) {
throw new UserException("Failed to get database: '" + dbName + "'
in catalog: " + dorisCatalog.getName());
}
String tableName = createTableInfo.getTableName();
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]