-
Notifications
You must be signed in to change notification settings - Fork 537
Update iceberg docs #5410
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
Merged
Merged
Update iceberg docs #5410
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cc81821
update iceberg docs
Tmonster 96ed591
more_updates
Tmonster 832aea1
PR comments, add attach options
Tmonster c3ab040
Merge remote-tracking branch 'tmonster/update-iceberg-docs' into upda…
Tmonster a1e7f0b
some more updates
Tmonster d806630
Rest catalog -> REST catalog
szarnyasg 30afa45
Rest catalog -> REST catalog
szarnyasg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
144 changes: 144 additions & 0 deletions
144
docs/stable/core_extensions/iceberg/iceberg_rest_catalogs.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,144 @@ | ||
| --- | ||
| layout: docu | ||
| redirect_from: null # maybe redirect from old amazon_s3_tables and amazon_sagemaker_lakehouse docs? | ||
| title: Iceberg REST Catalogs | ||
| --- | ||
|
|
||
| The `iceberg` extension supports attaching Iceberg REST Catalogs. Before attaching an Iceberg REST Catalog, you must install the `iceberg` extension by following the instructions located in the [overview]({% link docs/stable/core_extensions/iceberg/overview.md %}). | ||
|
|
||
| If you are attaching to an Iceberg REST Catalog managed by Amazon, please see the instructions for attaching to [Amazon S3 tables]({% link docs/stable/core_extensions/iceberg/amazon_s3_tables.md %}) or [Amazon Sagemaker Lakehouse]({% link docs/stable/core_extensions/iceberg/amazon_sagemaker_lakehouse.md %}). | ||
|
|
||
| For all other Iceberg REST Catalogs, you can follow the instructions below. Please see the [Examples](#examples) section for questions about specific catalogs. | ||
|
|
||
| Most Iceberg REST Catalogs authenticate via OAuth2. You can use the existing DuckDB secret workflow to store login credentials for the OAuth2 service. | ||
|
|
||
| ```sql | ||
| CREATE SECRET iceberg_secret ( | ||
| TYPE ICEBERG, | ||
| CLIENT_ID '⟨admin⟩', | ||
| CLIENT_SECRET '⟨password⟩', | ||
| OAUTH2_SERVER_URI '⟨http://irc_host_url.com/v1/oauth/tokens⟩' | ||
| ); | ||
| ``` | ||
|
|
||
| If you already have a Bearer token, you can pass it directly to your `CREATE SECRET` statement | ||
|
|
||
| ```sql | ||
| CREATE SECRET iceberg_secret ( | ||
| TYPE ICEBERG, | ||
| TOKEN '⟨bearer_token⟩' | ||
| ); | ||
| ``` | ||
|
|
||
| You can attach the Iceberg catalog with the following [`ATTACH`]({% link docs/stable/sql/statements/attach.md %}) statement. | ||
|
|
||
| ```sql | ||
| ATTACH '⟨warehouse⟩' AS iceberg_catalog ( | ||
| TYPE iceberg, | ||
| SECRET iceberg_secret, -- pass a specific secret name to prevent ambiguity | ||
| ENDPOINT ⟨https://rest_endpoint.com⟩ | ||
| ); | ||
| ``` | ||
|
|
||
| To see the available tables run | ||
| ```sql | ||
| SHOW ALL TABLES; | ||
| ``` | ||
|
|
||
| ### ATTACH OPTIONS | ||
|
|
||
| A REST Catalog with OAuth2 authorization can also be attached with just an `ATTACH` statement. See the complete list of `ATTACH` options for a REST catalog below. | ||
|
|
||
|
|
||
| | Parameter | Type | Default | Description | | ||
| | ---------------------------- | ---------- | -------- | ---------------------------------------------------------- | | ||
| | `ENDPOINT_TYPE` | `VARCHAR` | `NULL` | Used for attaching S3Tables or Glue catalogs. Allowed values are 'GLUE' and 'S3_TABLES' | | ||
| | `ENDPOINT` | `VARCHAR` | `NULL` | URL endpoint to communicate with the REST Catalog. Cannot be used in conjunction with `ENDPOINT_TYPE` | | ||
| | `SECRET` | `VARCHAR` | `NULL` | Name of secret used to communicate with the REST Catalog | | ||
| | `CLIENT_ID` | `VARCHAR` | `NULL` | CLIENT_ID used for Secret | | ||
| | `CLIENT_SECRET` | `VARCHAR` | `NULL` | CLIENT_SECRET needed for Secret | | ||
| | `DEFAULT_REGION` | `VARCHAR` | `NULL` | A Default region to use when communicating with the storage layer | | ||
| | `OAUTH2_SERVER_URI` | `VARCHAR` | `NULL` | OAuth2 server url for getting a Bearer Token | | ||
| | `AUTHORIZATION_TYPE` | `VARCHAR` | `OAUTH2` | Pass `SigV4` for Catalogs the require SigV4 authorization | | ||
|
|
||
|
|
||
| The following options can only be passed to a `CREATE SECRET` statement, and they require `AUTHORIZATION_TYPE` to be `OAUTH2` | ||
|
|
||
| | Parameter | Type | Default | Description | | ||
| | ---------------------------- | ---------- | -------- | ---------------------------------------------------------- | | ||
| | `OAUTH2_GRANT_TYPE` | `VARCHAR` | `NULL` | Grant Type when requesting an OAuth Token | | ||
| | `OAUTH2_SCOPE` | `VARCHAR` | `NULL` | Requested scope for the returned OAuth Access Token | | ||
|
|
||
| ## Specific Catalog Examples | ||
|
|
||
| ### R2 Catalog | ||
|
|
||
| To attach to an [R2 cloudflare](https://developers.cloudflare.com/r2/data-catalog/) managed catalog follow the attach steps below. | ||
|
|
||
|
|
||
| ```sql | ||
| CREATE SECRET r2_secret ( | ||
| TYPE ICEBERG, | ||
| TOKEN '⟨r2_token⟩' | ||
| ); | ||
|
|
||
| ``` | ||
|
|
||
| You can create a token by following the [create an API token](https://developers.cloudflare.com/r2/data-catalog/get-started/#3-create-an-api-token) steps in getting started. | ||
|
|
||
| Then, attach the catalog with the following commands. | ||
|
|
||
| ```sql | ||
| ATTACH '⟨warehouse⟩' AS my_r2_catalog ( | ||
| TYPE ICEBERG, | ||
| ENDPOINT '⟨catalog-uri⟩' | ||
| ); | ||
| ``` | ||
|
|
||
| The variables for `warehouse` and `catalog-uri` will be available under the settings of the desired R2 Object Storage Catalog (R2 Object Store > Catalog name > Settings). | ||
|
|
||
| ### Polaris | ||
|
|
||
| To attach to a [Polaris](https://polaris.apache.org) catalog the following commands will work. | ||
|
|
||
| ```sql | ||
| CREATE SECRET polaris_secret ( | ||
| TYPE ICEBERG, | ||
| CLIENT_ID '⟨admin⟩', | ||
| CLIENT_SECRET '⟨password⟩', | ||
| ); | ||
| ``` | ||
|
|
||
| ```sql | ||
| ATTACH 'quickstart_catalog' as polaris_catalog ( | ||
| TYPE ICEBERG, | ||
| ENDPOINT '⟨polaris_rest_catalog_endpoint⟩' | ||
| ); | ||
| ``` | ||
|
|
||
|
|
||
| ### Lakekeeper | ||
|
|
||
| To attach to a [Lakekeeper](https://docs.lakekeeper.io) catalog the following commands will work. | ||
|
|
||
| ```sql | ||
| CREATE SECRET lakekeeper_secret ( | ||
| TYPE ICEBERG, | ||
| CLIENT_ID '⟨admin⟩', | ||
| CLIENT_SECRET '⟨password⟩', | ||
| OAUTH2_SCOPE '⟨scope⟩', | ||
| OAUTH2_SERVER_URI '⟨lakekeeper_oauth_url⟩' | ||
| ); | ||
| ``` | ||
|
|
||
| ```sql | ||
| ATTACH '⟨warehouse⟩' as lakekeeper_catalog ( | ||
| TYPE ICEBERG, | ||
| ENDPOINT '⟨lakekeeper_irc_url⟩', | ||
| SECRET lakekeeper_secret | ||
| ); | ||
| ``` | ||
|
|
||
| ## Limitations | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: wydt of adding a sentence about catalog refreshing not being supported right now. the work around is reattach similar to duckdb/duckdb-iceberg#247 |
||
|
|
||
| Reading from Iceberg REST Catalogs backed by remote storage that is not S3 or S3Tables is not yet supported. | ||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not really for ambiguity, I think?
It's more that authorization options can be provided directly inside the
ATTACH(in the same way as the "create secret" options), but for reusability/deduplication the secret can be made beforehand and reused in the attach afterwardsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also that, but I can imagine users attach multiple catalogs that all require a different secret. I think it's best to go over all the options in a separate section