flyrain commented on code in PR #15525:
URL: https://github.com/apache/iceberg/pull/15525#discussion_r2990893272


##########
api/src/main/java/org/apache/iceberg/catalog/Catalog.java:
##########
@@ -347,6 +349,25 @@ default Table registerTable(TableIdentifier identifier, 
String metadataFileLocat
     throw new UnsupportedOperationException("Registering tables is not 
supported");
   }
 
+  /**
+   * Register a table with the catalog.
+   *
+   * @param identifier a table identifier
+   * @param metadataFileLocation the location of a metadata file
+   * @param overwrite whether to overwrite an existing table registration
+   * @return a Table instance
+   * @throws AlreadyExistsException if {@code overwrite} is false and the 
table already exists in
+   *     the catalog
+   */
+  default Table registerTable(

Review Comment:
   `CachingCatalog` should override the new `registerTable(identifier, 
metadataFileLocation, overwrite)` overload as well. Right now it only overrides 
the 2-arg variant, so calls with `overwrite=true` fall back to the default 
method on `Catalog`, which throws `UnsupportedOperationException` instead of 
delegating to the wrapped catalog. That means any catalog that supports 
overwrite registration loses that capability once it is wrapped by 
`CachingCatalog`. This wrapper should forward the 3-arg call and invalidate the 
cache just like the existing 2-arg implementation.



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