danielcweeks commented on code in PR #18203:
URL: https://github.com/apache/iceberg/pull/18203#discussion_r4074307427
##########
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java:
##########
@@ -805,6 +807,40 @@ public Table registerTable(
response.labels());
}
+ /**
+ * Unregister a table from the catalog without removing its data or metadata
files.
+ *
+ * <p>This is the opposite of {@link #registerTable(SessionContext,
TableIdentifier, String)}. On
+ * success, the table no longer exists in the catalog and the returned table
is fixed at the last
+ * metadata registered with the catalog.
+ *
+ * @param context session context
+ * @param identifier a table identifier
+ * @return a read-only table fixed at the metadata current when it was
unregistered
+ */
+ @Override
+ public Table unregisterTable(SessionContext context, TableIdentifier
identifier) {
+ Endpoint.check(endpoints, Endpoint.V1_UNREGISTER_TABLE);
+ checkIdentifierIsValid(identifier);
+
+ try {
+ AuthSession contextualSession = authManager.contextualSession(context,
catalogAuth);
+ UnregisterTableResponse response =
+ client
+ .withAuthSession(contextualSession)
+ .post(
+ paths.unregister(identifier),
+ null,
+ UnregisterTableResponse.class,
+ mutationHeaders,
+ ErrorHandlers.tableErrorHandler());
+ StaticTableOperations ops = new
StaticTableOperations(response.metadata(), io);
+ return new BaseTable(ops, fullTableName(identifier));
Review Comment:
I don't think we want to include the `fullTableName`. This should be the
`name` component of the table without the namespace. At this point the table
is unregistered, so it does not live in a namespace.
--
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]