Skip to content

feat(glue): make warehouse optional when loading the catalog - #3477

Open
David-Banquet wants to merge 1 commit into
apache:mainfrom
David-Banquet:glue-optional-warehouse
Open

David-Banquet wants to merge 1 commit into
apache:mainfrom
David-Banquet:glue-optional-warehouse

Conversation

@David-Banquet

Copy link
Copy Markdown

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 warehouse to derive the location of a new table whose Glue database has no LocationUri. GlueCatalogBuilder::load still 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's GlueCatalog accepts it and only fails in defaultWarehouseLocation.

  • load no longer checks warehouse.
  • get_default_table_location returns a Result and fails with DataInvalid when the namespace has no location and the warehouse is empty. create_table propagates it, so the error now happens there, as in Java.
  • The doc comment of GLUE_CATALOG_PROP_WAREHOUSE says what it is used for.

Are these changes tested?

Yes, with unit tests:

  • test_load_without_warehouse replaces test_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 gets DataInvalid.

cargo clippy -p iceberg-catalog-glue --all-targets -- -D warnings is clean, and the iceberg-catalog-glue and iceberg-catalog-loader unit tests pass.

AI Disclosure

Written with the help of Claude Code. I reviewed the change and the tests.

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warehouse path is always required for Glue catalog, even when there isn't one

1 participant