danielcweeks commented on code in PR #16584:
URL: https://github.com/apache/iceberg/pull/16584#discussion_r3501798135
##########
core/src/main/java/org/apache/iceberg/rest/CatalogHandlers.java:
##########
@@ -488,6 +490,27 @@ public static void dropTable(Catalog catalog,
TableIdentifier ident) {
}
}
+ public static UnregisterTableResponse unregisterTable(Catalog catalog,
TableIdentifier ident) {
+ // capture the last metadata before dropping so it can be returned for
re-registration
+ Table table = catalog.loadTable(ident);
+ if (!(table instanceof BaseTable)) {
+ throw new IllegalStateException("Cannot wrap catalog that does not
produce BaseTable");
+ }
+
+ TableMetadata metadata = ((BaseTable) table).operations().current();
+
+ // unregister without removing the underlying data and metadata files
Review Comment:
```suggestion
// catalog implementations should preserve the table's metadata/data
files
```
I think it's correct not to purge, but that's not really what purge
indicates. Purge is a request to the catalog to remove the data, but it
doesn't guarantee that the data remains. The comment doesn't quite accurately
reflect this.
Real catalog implementations should handle this by preserving the files
(i.e. not purging immediately or scheduling for normal drop table lifecycle
deletion).
--
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]