gaborkaszab commented on code in PR #17847:
URL: https://github.com/apache/iceberg/pull/17847#discussion_r3879033837
##########
core/src/main/java/org/apache/iceberg/MetadataTableType.java:
##########
@@ -45,4 +46,16 @@ public static MetadataTableType from(String name) {
return null;
}
}
+
+ public static MetadataTableType from(TableIdentifier identifier) {
+ // An identifier only refers to a metadata table when its base table (the
identifier without
+ // its last part) still has a namespace, which requires at least two
namespace levels here.
+ // This lets a regular table reuse a metadata table name (e.g. "db.files")
without being
+ // mistaken for the "files" metadata table of namespace "db".
+ if (identifier.namespace().levels().length >= 2) {
Review Comment:
I don't think this is a bullet proof solution of the problem, it just guards
against cases where namespace is one level. For multi-level namespaces we still
won't be able to create a regular table with a metadata table name, right?
--
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]