Repository navigation
feat(glue): make warehouse optional when loading the catalog - #3477
Open
David-Banquet wants to merge 1 commit into
Open
David-Banquet wants to merge 1 commit into
David-Banquet wants to merge 1 commit into
Conversation
The Glue catalog only uses the warehouse to derive the location of a new table whose namespace has no location. Like the Java catalog, loading no longer requires it, and create_table fails with DataInvalid only when neither is set. Closes apache#941
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
What changes are included in this PR?
Follow-up to #3102, as discussed in #941. The Glue catalog only uses
warehouseto derive the location of a new table whose Glue database has noLocationUri.GlueCatalogBuilder::loadstill refused a missing or empty warehouse before any call to Glue, so a read-only client, or one that always creates tables in databases with a location, could not load the catalog without one. Java'sGlueCatalogaccepts it and only fails indefaultWarehouseLocation.loadno longer checkswarehouse.get_default_table_locationreturns aResultand fails withDataInvalidwhen the namespace has no location and the warehouse is empty.create_tablepropagates it, so the error now happens there, as in Java.GLUE_CATALOG_PROP_WAREHOUSEsays what it is used for.Are these changes tested?
Yes, with unit tests:
test_load_without_warehousereplacestest_load_rejects_missing_or_empty_warehouse: loading with no warehouse, or an empty one, succeeds.test_get_default_table_location_without_warehouse: with no warehouse, a namespace with a location still gets<location>/<table>, and one without a location getsDataInvalid.cargo clippy -p iceberg-catalog-glue --all-targets -- -D warningsis clean, and theiceberg-catalog-glueandiceberg-catalog-loaderunit tests pass.AI Disclosure
Written with the help of Claude Code. I reviewed the change and the tests.