RussellSpitzer commented on a change in pull request #3089:
URL: https://github.com/apache/iceberg/pull/3089#discussion_r704840027



##########
File path: core/src/main/java/org/apache/iceberg/MetadataTableUtils.java
##########
@@ -30,11 +30,25 @@ public static boolean hasMetadataTableName(TableIdentifier 
identifier) {
     return MetadataTableType.from(identifier.name()) != null;
   }
 
+  public static Table createMetadataTableInstance(Table table, 
MetadataTableType type) {
+    if (table instanceof BaseTable) {
+      TableOperations ops = ((BaseTable) table).operations();
+      return createMetadataTableInstance(ops, table, 
metadataTableName(table.name(), type), type);
+    } else {
+      throw new IllegalArgumentException(String.format("Cannot create metadata 
table for table: %s", table));

Review comment:
       Could we clarify this? I know we had a pr around this error message 
before when table instanceOf[MetadataTable] or something like that.  A user had 
plugged in "table.files" instead of "table" into an action and gotten a message 
like this. I'm actually not sure what would be better in this case, "Cannot 
create load metadata for non-base table %s?"




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