Repository navigation
Add coordinated commits API to the spec - #1127
Conversation
25157f5 to
5dfafdc
Compare
6368944 to
f251da9
Compare
|
|
||
| | Method | HTTP request | Description | | ||
| |------------- | ------------- | -------------| | ||
| | [**commit**](CoordinatedCommitsApi.md#commit) | **POST** /delta/preview/commits | Commit changes to a specified table WARNING: This API is experimental and may change in future versions. | |
There was a problem hiding this comment.
nit: maybe we can just decalare for the first sentence that this API is expeirmental, add this warning for every fields seems like to be a bit nosiy.
There was a problem hiding this comment.
Oh, those are API list here. not the api fields.
| | **table\_id** | **String**| The table ID provided by UC on table creation that we want to get the commits for. In the context of UC, this is the UUID that uniquely identifies a table. | [default to null] | | ||
| | **table\_uri** | **String**| The URI of the storage location of the table. If the table_id exists but the table_uri is different from the one previously registered (e.g., if the client moved the table), the request will fail. | [default to null] | | ||
| | **start\_version** | **Long**| The start version from which to retrieve commits (inclusive). | [default to null] | | ||
| | **end\_version** | **Long**| The end version upto which to retrieve commits (inclusive). If not set, the latest version will be used as the end version. This does not affect the latest_table_version in the response. If num of commits that meet this criteria is > 50, the response will be paginated to the first 50 commits. | [optional] [default to null] | |
There was a problem hiding this comment.
If the num of commits >50, do we currently have api to fetch the next page ? Seems like it a bit tricky for me, since it currently always get the first 50.
There was a problem hiding this comment.
Oh, you mean people can specify the start_version to fetch the next 50 commits in a batch, right ?
There was a problem hiding this comment.
Yes. That's a good point. I just added a sentence to describe that.
| description: The modification time of the commit file. This is the mod time of the file as written to the file system. | ||
| is_disown_commit: | ||
| type: boolean | ||
| description: Should be set if this commit is a disown commit that removes UC as the commit coordinator from the table. |
There was a problem hiding this comment.
What's the meaning of disown ? what's the behavior if we set this field as true or false ? Could you please explain more ?
There was a problem hiding this comment.
disown means that this table no longer wants to use UC as the commit coordinator. This releases UC the responsibility of maintaining any unbackfilled commit and makes sure that all commits are backfilled. Sort of like converting it to an EXTERNAL table. There could be use cases that want to copy the entire table files to somewhere else for example.
@tdas do we want to support this ever in the future? My current impl doesn't support that yet.
There was a problem hiding this comment.
lets add this to the spec in the future. we can always add stuff as optional fields in the future when we have more clarity. lets just start with the core functionality.
so remove it for now.
| A metastore is the top-level container of objects in Unity Catalog that stores all UC assets. | ||
| - name: CoordinatedCommits | ||
| description: | | ||
| "Coordinated commits" is a Delta tables feature that allows Delta tables to designate a coordinator to coordinate commits. This is Unity Catalog's API to allow Unity Catalog be the commit coordinator for managed tables. (See https://github.com/delta-io/delta/blob/master/PROTOCOL.md for more details) |
There was a problem hiding this comment.
Is the https://github.com/delta-io/delta/blob/master/PROTOCOL.md correct page for details ? Seems no mention about the coordinator commits.
There was a problem hiding this comment.
It is not published yet. I just put it here as a place holder.
There was a problem hiding this comment.
can you link to the RFC instead and say that it is
so basicaly linked to both.
There was a problem hiding this comment.
| parameters: | ||
| - name: table_id | ||
| in: query | ||
| description: The table ID provided by UC on table creation that we want to get the commits for. In the context of UC, this is the UUID that uniquely identifies a table. |
There was a problem hiding this comment.
this is the UUID that uniquely identifies a table.
For the api level, I think it's good enough to say it uniquely identifies a table , but no necessary to say it's definitely a UUID type. any unique string is possible to represent the tableId, no necessary UUID, I think.
| in: query | ||
| description: | | ||
| The URI of the storage location of the table. If the table_id exists but the table_uri is | ||
| different from the one previously registered (e.g., if the client moved the table), the request will fail. |
There was a problem hiding this comment.
Do we need to have an example here, I guess it will be s3://bucket/key or something like that ?
| required: true | ||
| schema: | ||
| type: string | ||
| - name: start_version |
There was a problem hiding this comment.
Is this start_version an auto incremental field, or will it be comparable to the end_version ?
There was a problem hiding this comment.
It's basically specifying a pagination range of [start_version, end_version]. Server may also shrink the range in order not to exceeds 50 versions per response.
Added clarification here.
There was a problem hiding this comment.
see comment below. 50 is a implementation detail
| '409': | ||
| description: Conflict. Indicates that a commit with the same version already exists. | ||
| '429': | ||
| description: The maximum number of unbackfilled commits per table has been reached. Please backfill some commits before retrying. |
There was a problem hiding this comment.
The maximum number of unbackfilled commits per table has been reached.
Usually, what's the threshold ?
There was a problem hiding this comment.
It's 50. But I am not sure if this will be part of the published spec. Or we'll keep it as an internal impl detail.
Anyway it shouldn't exceed as client is expected to do backfill asap.
There was a problem hiding this comment.
openinx
left a comment
There was a problem hiding this comment.
Looks good to me overall, just left several small comments.
7ef24e8 to
01af65c
Compare
| If num of commits that meet this criteria is > 50, the response will be paginated to the | ||
| first 50 commits. Call can send request again with a larger start_version to get the | ||
| remaining commits. |
There was a problem hiding this comment.
50 is an implementation choice the server can make based on the backend database requirements (how much store. from the catalog spec it perfectly correct to have the threshold be 1. please make that clear.
in the implementation, this needs to be a server property
| '400': | ||
| description: | | ||
| Bad request or Invalid Argument. Example: table_uri in the request doesn't match the existing table_uri for the table. | ||
| '401': | ||
| description: Unauthorized. Authentication credentials are missing or incorrect. | ||
| '403': | ||
| description: Forbidden. The user does not have the necessary permissions to perform this action. | ||
| '404': | ||
| description: Not Found. The specified table does not exist. |
There was a problem hiding this comment.
@yili-db we need to make sure that these are response codes are tested as well
tdas
left a comment
There was a problem hiding this comment.
Overall looks good. please address all the comments. then i will merge.
5306e82 to
2b2d75d
Compare
Signed-off-by: Yi Li <[email protected]>
Signed-off-by: Yi Li <[email protected]>
## 🥞 Stacked PR Use this [link](https://github.com/unitycatalog/unitycatalog/pull/1127/files) to review incremental changes. - [**commit_api**](unitycatalog#1127) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1127/files)] - [stack/commit_basic](unitycatalog#1166) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1166/files/725c6b686f9f169fb10d7109dfa2c5ea2cd58a4e..2ec21c04831867e54feef742774af6c7b034dea1)] - [stack/commit_backfill_delete_meta](unitycatalog#1169) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1169/files/6d0a2246ce9ded3408587e35355ad46deb22dd2d..711f75644a2ae2559277413d36c8e7118a9bd3ca)] - [stack/commit_get](unitycatalog#1170) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1170/files/333883036048eb3c5fc5defd6ad193849b2286a4..3e5b8dfe047577223b7e9decac67725e5f4d6c76)] --------- **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. - [ ] 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** Add coordinated commits API to the spec Related issue is: unitycatalog#1143 --------- Signed-off-by: Yi Li <[email protected]>
🥞 Stacked PR
Use this link to review incremental changes.
PR Checklist
docsis updatedDescription of changes
Add coordinated commits API to the spec
Related issue is: #1143