Skip to content

[0.2] handle catalog and namespace properly in Iceberg REST api (#324) - #742

Merged
tdas merged 2 commits into
unitycatalog:branch-0.2from
alexreid-db:cherrypick-warehouse-update-v0.2
Nov 19, 2024
Merged

tdas merged 2 commits into
unitycatalog:branch-0.2from
alexreid-db:cherrypick-warehouse-update-v0.2

Conversation

@alexreid-db

Copy link
Copy Markdown
Collaborator

PR Checklist

  • A description of the changes is added to the description of this PR.
  • If there is a related issue, make sure it is linked to this PR.
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added or modified a feature, documentation in docs is updated

Description of changes

Prior to this PR, users were required to lookup namespace and tables by supplying the uc catalog name in the namespace identifier which isn't proper and lead to problems. This PR implements the REST client flow of configuring calls to the API with a defined prefix containing the catalog name. The catalog name is now part of the API paths and broken apart from the namespace.

Client (passes warehouse parameter) -> Server Config Endpoint (response has override for URL prefix) -> Client
Subsequent calls to the API now has url prefixed with /catalogs/{warehouse/catalog-name}

This PR "binds" the spark catalog to a UC catalog using the client config endpoint. Users must now add to their catalog configurations something like (example in spark):

"spark.sql.catalog.<spark-catalog-name>.warehouse": "<catalog-name>" and now address tables like
<spark-catalog-name>.<namespace-name>.<table-name>

This should address
#182 and parts of #3.


Signed-off-by: Alex Reid [email protected]

(cherry picked from commit 3bf4a01)

PR Checklist

  • A description of the changes is added to the description of this PR.
  • If there is a related issue, make sure it is linked to this PR.
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added or modified a feature, documentation in docs is updated

Description of changes

…og#324)

**PR Checklist**

- [x] A description of the changes is added to the description of this
PR.
- [x] If there is a related issue, make sure it is linked to this PR.
- [x] If you've fixed a bug or added code that should be tested, add
tests!
- [x] If you've added or modified a feature, documentation in `docs` is
updated

**Description of changes**

Prior to this PR, users were required to lookup namespace and tables by
supplying the uc catalog name in the namespace identifier which isn't
proper and lead to problems. This PR implements the REST client flow of
configuring calls to the API with a defined prefix containing the
catalog name. The catalog name is now part of the API paths and broken
apart from the namespace.

Client (passes warehouse parameter) -> Server Config Endpoint (response
has override for URL prefix) -> Client
Subsequent calls to the API now has url prefixed with
`/catalogs/{warehouse/catalog-name}`

This PR "binds" the spark catalog to a UC catalog using the client
config endpoint. Users must now add to their catalog configurations
something like (example in spark):

`"spark.sql.catalog.<spark-catalog-name>.warehouse": "<catalog-name>"`
and now address tables like
`<spark-catalog-name>.<namespace-name>.<table-name>`

This should address
unitycatalog#182 and parts of
unitycatalog#3.

---------

Signed-off-by: Alex Reid <[email protected]>

(cherry picked from commit 3bf4a01)
Signed-off-by: Alex Reid <[email protected]>
@tdas tdas changed the title handle catalog and namespace properly in Iceberg REST api (#324) [0.2] handle catalog and namespace properly in Iceberg REST api (#324) Nov 19, 2024

@tdas tdas 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.

thank you for the backport!

@tdas
tdas merged commit 86e8c6c into unitycatalog:branch-0.2 Nov 19, 2024
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.

3 participants