Skip to content

Add coordinated commits API to the spec - #1127

Merged
tdas merged 2 commits into
unitycatalog:mainfrom
yili-db:commit_api
Nov 7, 2025
Merged

tdas merged 2 commits into
unitycatalog:mainfrom
yili-db:commit_api

Conversation

@yili-db

@yili-db yili-db commented Oct 23, 2025 •

Copy link
Copy Markdown
Collaborator

🥞 Stacked PR

Use this link to review incremental changes.


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

Add coordinated commits API to the spec

Related issue is: #1143

@yili-db
yili-db force-pushed the commit_api branch 2 times, most recently from 25157f5 to 5dfafdc Compare October 28, 2025 05:22
@yili-db
yili-db force-pushed the commit_api branch 2 times, most recently from 6368944 to f251da9 Compare November 4, 2025 21:45
@yili-db yili-db mentioned this pull request Nov 5, 2025
4 tasks
Comment thread api/Apis/CoordinatedCommitsApi.md Outdated

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Oh, those are API list here. not the api fields.

Comment thread api/Apis/CoordinatedCommitsApi.md Outdated
| **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] |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Oh, you mean people can specify the start_version to fetch the next 50 commits in a batch, right ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes. That's a good point. I just added a sentence to describe that.

Comment thread api/all.yaml Outdated
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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What's the meaning of disown ? what's the behavior if we set this field as true or false ? Could you please explain more ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

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.

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.

Comment thread api/all.yaml Outdated
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)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is the https://github.com/delta-io/delta/blob/master/PROTOCOL.md correct page for details ? Seems no mention about the coordinator commits.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It is not published yet. I just put it here as a place holder.

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.

can you link to the RFC instead and say that it is

so basicaly linked to both.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Comment thread api/all.yaml Outdated
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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Comment thread api/all.yaml
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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we need to have an example here, I guess it will be s3://bucket/key or something like that ?

Comment thread api/all.yaml
required: true
schema:
type: string
- name: start_version

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this start_version an auto incremental field, or will it be comparable to the end_version ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

@tdas tdas Nov 6, 2025 •

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.

see comment below. 50 is a implementation detail

Comment thread api/all.yaml
'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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The maximum number of unbackfilled commits per table has been reached.

Usually, what's the threshold ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

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.

@openinx openinx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me overall, just left several small comments.

@yili-db
yili-db force-pushed the commit_api branch 2 times, most recently from 7ef24e8 to 01af65c Compare November 6, 2025 00:59
@yili-db
yili-db requested a review from openinx November 6, 2025 00:59
Comment thread api/all.yaml Outdated
Comment on lines +1448 to +1450
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.

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.

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

Comment thread api/all.yaml
Comment on lines +1462 to +1470
'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.

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.

@yili-db we need to make sure that these are response codes are tested as well

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes. Will do.

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

Overall looks good. please address all the comments. then i will merge.

@yili-db
yili-db force-pushed the commit_api branch 2 times, most recently from 5306e82 to 2b2d75d Compare November 6, 2025 20:35

@openinx openinx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, thanks @yili-db for the work.

@tdas
tdas merged commit 0c6aac4 into unitycatalog:main Nov 7, 2025
yili-db added a commit to yili-db/unitycatalog that referenced this pull request Nov 19, 2025
## 🥞 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]>
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