nastra commented on code in PR #13434:
URL: https://github.com/apache/iceberg/pull/13434#discussion_r2288295303
##########
core/src/main/java/org/apache/iceberg/BaseMetastoreCatalog.java:
##########
@@ -91,6 +96,16 @@ public Table registerTable(TableIdentifier identifier,
String metadataFileLocati
return new BaseTable(ops, fullTableName(name(), identifier),
metricsReporter());
}
+ protected void targetNamespaceExists(TableIdentifier identifier) {
Review Comment:
We're adding the namespace check at a central place that now affects all
catalogs extending this class. I think the main issue is that not every catalog
actually requires an explicit namespace creation before e.g. creating a table
inside a namespace or registering a table. That's also why we introduced the
`requiresNamespaceCreate()` flag in the tests.
That being said, I don't think we can actually perform this check here as it
should be specific to the respective catalog implementation and depending on
whether that catalog implementation actually requires a namespace to be
created or not.
For example, the default behavior of the JDBC catalog is to not require a
namespace to exist when you create a table. That means registering a table
should also not require for that namespace to exist beforehand.
However, if you configure strict-mode, then namespace existence is required,
meaning that the `targetNamespaceExists` check should only be performed when
strict-mode is on
--
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]