Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for prefix configuration in Iceberg REST catalog #22441

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

ajantha-bhat
Copy link
Member

@ajantha-bhat ajantha-bhat commented Jun 19, 2024

Description

REST catalog supports a prefix in the resource path as per the spec. But it is not exposed from Trino IcebergRestCatalogConfig. In Spark, this works by default because they accept generic property bag.

Additional context and related issues

Iceberg side usage:
https://github.com/apache/iceberg/blob/cbd11d7aa54a3b531f59a5e83411a163f9126a0c/core/src/main/java/org/apache/iceberg/rest/ResourcePaths.java#L31

Release notes

# Iceberg
* Add support for specifying a resource [prefix](https://github.com/apache/iceberg/blob/a47937c0c1fcafe57d7dc83551d8c9a3ce0ab1b9/open-api/rest-catalog-open-api.yaml#L1449-L1455) in REST catalog. 

@cla-bot cla-bot bot added the cla-signed label Jun 19, 2024
@github-actions github-actions bot added docs iceberg Iceberg connector labels Jun 19, 2024
@ajantha-bhat ajantha-bhat requested a review from nastra June 19, 2024 15:04
@ajantha-bhat
Copy link
Member Author

cc: @snazy, @dimas-b, @danielcweeks

Copy link

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

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

I think it's a nice improvement for integrating with the REST Catalog 👍

@@ -85,6 +87,7 @@ public synchronized TrinoCatalog create(ConnectorIdentity identity)
ImmutableMap.Builder<String, String> properties = ImmutableMap.builder();
properties.put(CatalogProperties.URI, serverUri.toString());
warehouse.ifPresent(location -> properties.put(CatalogProperties.WAREHOUSE_LOCATION, location));
prefix.ifPresent(prefix -> properties.put("prefix", prefix));
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be added to CatalogProperties in Iceberg?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is specific to single catalog (not all catalogs). Hence, it was not added I guess.

Plus change at Iceberg needs a release, which will take time. We can update in the followup if the community agrees on it.

Copy link
Member

@ebyhr ebyhr left a comment

Choose a reason for hiding this comment

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

REST catalog: Support prefix configuration

Please follow the commit message guideline. You can change to "Add support for prefix configuration in Iceberg REST catalog" or something.
https://github.com/trinodb/trino/blob/master/.github/DEVELOPMENT.md#format-git-commit-messages

@ajantha-bhat ajantha-bhat changed the title REST catalog: Support prefix configuration Add support for prefix configuration in Iceberg REST catalog Jun 20, 2024
REST catalog supports a `prefix` in the resource path as per the spec.
But it is not exposed from Trino `IcebergRestCatalogConfig`.
In Spark, this works by default because they accept generic property bag.
@ebyhr ebyhr merged commit 4d75d23 into trinodb:master Jun 24, 2024
46 checks passed
@github-actions github-actions bot added this to the 451 milestone Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

4 participants