Skip to content

Core: Implement unregister table in catalogs and RCKs - #18203

Merged
danielcweeks merged 11 commits into
apache:mainfrom
mkroll-db:unregister-table
Oct 1, 2026
Merged

danielcweeks merged 11 commits into
apache:mainfrom
mkroll-db:unregister-table

Conversation

@mkroll-db

@mkroll-db mkroll-db commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Adds catalog-level unregisterTable support introduced in #16400 in the REST catalog fixture and compatibility kit.

Unregister removes a table from the catalog without deleting its data or metadata files.
It returns a read-only table containing the last registered metadata. This can be used to register the table (with another catalog) again.

Disclaimer
Parts of the code were generated with AI.
This is a reopen of #16584 from @rambleraptor

@mkroll-db
mkroll-db marked this pull request as ready for review September 22, 2026 16:55
Comment thread core/src/main/java/org/apache/iceberg/rest/ResourcePaths.java Outdated
Comment thread core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java Outdated
Comment thread api/src/main/java/org/apache/iceberg/Table.java Outdated
Comment thread core/src/main/java/org/apache/iceberg/BaseTable.java Outdated
Comment thread core/src/main/java/org/apache/iceberg/SerializableTable.java Outdated
@rambleraptor

Copy link
Copy Markdown
Contributor

Thanks for getting this going again @mkroll-db! This fell off my radar.

Comment thread core/src/test/java/org/apache/iceberg/jdbc/TestJdbcCatalog.java Outdated
Comment thread core/src/test/java/org/apache/iceberg/jdbc/TestJdbcCatalog.java Outdated
@mkroll-db

mkroll-db commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

@rambleraptor I'm fine in closing the current PR and reviving yours. I just wanted to ensure that we continue working on it. It fell off my radar first so.

Comment on lines +326 to +337
Tasks.foreach(identifier)
.retry(initialMetadata.propertyAsInt(COMMIT_NUM_RETRIES, COMMIT_NUM_RETRIES_DEFAULT))
.exponentialBackoff(
initialMetadata.propertyAsInt(
COMMIT_MIN_RETRY_WAIT_MS, COMMIT_MIN_RETRY_WAIT_MS_DEFAULT),
initialMetadata.propertyAsInt(
COMMIT_MAX_RETRY_WAIT_MS, COMMIT_MAX_RETRY_WAIT_MS_DEFAULT),
initialMetadata.propertyAsInt(
COMMIT_TOTAL_RETRY_TIME_MS, COMMIT_TOTAL_RETRY_TIME_MS_DEFAULT),
2.0 /* exponential */)
.onlyRetryOn(CommitFailedException.class)
.run(tableIdentifier -> unregistered.set(unregisterTableOnce(tableIdentifier)));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make sense to me. Unregister is a single operation, so why do we have retry with exponential backoff? We don't do this for other operations like rename. Overall, seems unnecessary and over complicated.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially I had a foreach (endless)-loop which I didn't like. I then looked at the code and found that exponentialBackoff is used which was much better.
BUT I agree it's overkill. I removed it in d07d8c6

Comment thread core/src/main/java/org/apache/iceberg/rest/CatalogHandlers.java Outdated
Comment thread core/src/main/java/org/apache/iceberg/jdbc/JdbcCatalog.java Outdated

@danielcweeks danielcweeks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mkroll-db!

@danielcweeks
danielcweeks merged commit ca670d7 into apache:main Oct 1, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants