Repository navigation
Implement getCommits for Delta commits retrieval - #1170
Conversation
## 🥞 Stacked PR Use this [link](https://github.com/unitycatalog/unitycatalog/pull/1127/files) to review incremental changes. - [**commit_api**](#1127) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1127/files)] - [stack/commit_basic](#1166) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1166/files/725c6b686f9f169fb10d7109dfa2c5ea2cd58a4e..2ec21c04831867e54feef742774af6c7b034dea1)] - [stack/commit_backfill_delete_meta](#1169) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1169/files/6d0a2246ce9ded3408587e35355ad46deb22dd2d..711f75644a2ae2559277413d36c8e7118a9bd3ca)] - [stack/commit_get](#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: #1143 --------- Signed-off-by: Yi Li <[email protected]>
d1b58da to
40ae68c
Compare
13dbff7 to
0a7a307
Compare
491b414 to
82e06ef
Compare
ddc2e88 to
ff7ff1d
Compare
c262a57 to
b90be16
Compare
b90be16 to
60a3cc2
Compare
## 🥞 Stacked PR Use this [link](https://github.com/unitycatalog/unitycatalog/pull/1199/files) to review incremental changes. - [**stack/commit_api_2**](#1199) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1199/files)] - [stack/commit_backfill_delete_meta](#1169) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1169/files/a78dfb470b5128f01ee6c44ccadea2473005a8a2..5e4aff2b0ec2c0518c3ff718d1dfda965d6ff1f5)] - [stack/commit_get](#1170) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1170/files/5e4aff2b0ec2c0518c3ff718d1dfda965d6ff1f5..60a3cc2d4e2ef30ee1853a23f2f46f5d00fbc261)] - [stack/commit_access_test](#1178) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1178/files/60a3cc2d4e2ef30ee1853a23f2f46f5d00fbc261..dae5d6f57ba8bb0e16037bab00de9393da1553c0)] - [stack/ccv2_spark](#1186) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1186/files/dae5d6f57ba8bb0e16037bab00de9393da1553c0..be0473cf83f0e100142403a0134409658dc9760a)] --------- **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** Update DeltaCommits API - Change getCommits api to use json payload for its parameters. This is the method actually used by Delta Spark - Rename CoordinatedCommits to DeltaCommits in API **Related issue** #1143 --------- Signed-off-by: Yi Li <[email protected]>
be93805 to
6e1ceb0
Compare
## 🥞 Stacked PR Use this [link](https://github.com/unitycatalog/unitycatalog/pull/1169/files) to review incremental changes. - [**stack/commit_backfill_delete_meta**](#1169) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1169/files)] - [stack/commit_get](#1170) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1170/files/eee17f0c3f9e6a456523fb0bf502b560a31ddea7..6e1ceb0c6747f1c85bc344b25b6d982dc964a8b3)] - [stack/commit_access_test](#1178) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1178/files/6e1ceb0c6747f1c85bc344b25b6d982dc964a8b3..7cb3ace271839563449be4a900f5260633c423b5)] - [stack/ccv2_spark](#1186) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1186/files/7cb3ace271839563449be4a900f5260633c423b5..72eff6e86a48ecdcddbd407a5d7f5edabad35a7c)] --------- **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** This commit implements backfill and metadata update functionality for Delta commits in Unity Catalog: - Backfilling and deletion of old commit metadata - Commit limit enforcement - Table metadata updates via commits - Comprehensive test coverage **Related issue** #1143 --------- Signed-off-by: Yi Li <[email protected]>
| DeltaGetCommitsResponse response = | ||
| getCommits(tableInfo.getTableId(), tableInfo.getStorageLocation(), 0L, Optional.empty()); | ||
| assertEquals(5, response.getCommits().size()); | ||
| assertEquals(5, response.getLatestTableVersion()); |
There was a problem hiding this comment.
why are you only testing the latest and not the full range?
There was a problem hiding this comment.
also shouldnt you be verifying the rest of the content of the Commit? like paths and stuff? without that how are we validating that server is returning the same information as what has been committed?
There was a problem hiding this comment.
In another test testBasicCoordinatedCommitsCRUD it has already verified that the same information is returned.
This test is for testing the backfill behavior. The focus is that old versions are removed from the response. So it skips the content but only checks the version numbers.
| assertThat(response.getCommits().get(0).getVersion()).isEqualTo(5L); | ||
| assertThat(response.getCommits().get(1).getVersion()).isEqualTo(4L); | ||
| assertThat(response.getCommits().get(2).getVersion()).isEqualTo(3L); |
There was a problem hiding this comment.
this should basically be simple function to create a Collection/List of ints out of the response and compared as a expected collection/list of ints. and getLatestTableVersion can also be tested in that function. size gets implicitly tested.
there small places of duplicate code patterns like this all over the place. think about deduping these common patterns.
| * <p>This method returns commits that fall within the requested version range [startVersion, | ||
| * endVersion]. The response includes both the list of commits and the latest table version. | ||
| * | ||
| * <p><b>Pagination:</b> Results are always limited to MAX_NUM_COMMITS_PER_TABLE (50) commits per |
There was a problem hiding this comment.
this is wrong number now.
this is the cost of embedding too much information in comments.. they easily go out of date.
| assertEquals(4, response.getCommits().size()); | ||
| assertEquals(10, response.getLatestTableVersion()); |
There was a problem hiding this comment.
again, why arent you verifying the full version range of whats returned.
6e1ceb0 to
36b79f9
Compare
36b79f9 to
73a4c07
Compare
This commit adds the ability to retrieve commits for managed Delta tables with coordinated commit semantics, completing the read path for the coordinated commits API. Key features: - Version range filtering (inclusive start and end) - Returns commits in descending order (newest first) - Returns latestTableVersion even when commit list is empty - Proper error handling for invalid parameters Signed-off-by: Yi Li <[email protected]>
73a4c07 to
2170d0b
Compare
| private void verifyDeltaGetCommitsResponse( | ||
| DeltaGetCommitsResponse response, | ||
| long expectedLatestTableVersion, | ||
| Object... expectedCommits) { |
There was a problem hiding this comment.
nit: add docs explaining that this can be version as Integer/Long or DeltaCommit
| // Get commits with pagination: start_version=0, end_version=3 | ||
| DeltaGetCommitsResponse response = | ||
| getAllCommits(tableInfo.getTableId(), tableInfo.getStorageLocation(), 0L, Optional.of(3L)); | ||
| verifyDeltaGetCommitsResponse(response, 10, 3, 2, 1); |
There was a problem hiding this comment.
nit: not very readable. not obvious which number is what version. would be nice to do /* latest = */ 10, /* expectedVersions = */ 3, 2, 1)
tdas
left a comment
There was a problem hiding this comment.
just a few comments that can be addressed in the next PR
## 🥞 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]>
) Use this [link](https://github.com/unitycatalog/unitycatalog/pull/1166/files) to review incremental changes. - [**stack/commit_basic**](unitycatalog#1166) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1166/files)] - [stack/commit_api_2](unitycatalog#1199) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1199/files/8c6992aaad6b981ef38a4fb468ef700f083ad49a..d0d4f606101bc705a6a79514a2b4ba31b2b19b19)] - [stack/commit_backfill_delete_meta](unitycatalog#1169) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1169/files/d0d4f606101bc705a6a79514a2b4ba31b2b19b19..93dc85893930d1594b3a974cc48228c767f826ab)] - [stack/commit_get](unitycatalog#1170) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1170/files/93dc85893930d1594b3a974cc48228c767f826ab..0e7306a1c14f5476eeef78953b948fd2f7ba0453)] - [stack/commit_access_test](unitycatalog#1178) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1178/files/0e7306a1c14f5476eeef78953b948fd2f7ba0453..6042111d1b885fc5a9cf687b670c98b95ade14d7)] - [stack/ccv2_spark](unitycatalog#1186) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1186/files/6042111d1b885fc5a9cf687b670c98b95ade14d7..cc09752cb91d6c9e6bf474ebc05c82f7a0da95cc)] --------- **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** This commit adds API support for committing Delta table versions to Unity Catalog with coordinated commit semantics. When multiple clients attempt to commit the same version simultaneously, UC guarantees that only one will succeed. Key features: - POST endpoint at /delta/preview/commits for committing new table versions - Strict sequential version validation (version N+1 must follow version N) - Onboarding flow for tables with no existing commits - Comprehensive validation of commit metadata and table properties - Only managed delta tables are supported Known limitations (documented in code): - Table metadata updates not yet implemented - Backfill of commits not yet supported - Cleanup of commits when deleting tables not yet implemented - RPC support for reading commit lists not yet implemented **Related issue** unitycatalog#1143 --------- Signed-off-by: Yi Li <[email protected]>
## 🥞 Stacked PR Use this [link](https://github.com/unitycatalog/unitycatalog/pull/1199/files) to review incremental changes. - [**stack/commit_api_2**](unitycatalog#1199) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1199/files)] - [stack/commit_backfill_delete_meta](unitycatalog#1169) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1169/files/a78dfb470b5128f01ee6c44ccadea2473005a8a2..5e4aff2b0ec2c0518c3ff718d1dfda965d6ff1f5)] - [stack/commit_get](unitycatalog#1170) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1170/files/5e4aff2b0ec2c0518c3ff718d1dfda965d6ff1f5..60a3cc2d4e2ef30ee1853a23f2f46f5d00fbc261)] - [stack/commit_access_test](unitycatalog#1178) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1178/files/60a3cc2d4e2ef30ee1853a23f2f46f5d00fbc261..dae5d6f57ba8bb0e16037bab00de9393da1553c0)] - [stack/ccv2_spark](unitycatalog#1186) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1186/files/dae5d6f57ba8bb0e16037bab00de9393da1553c0..be0473cf83f0e100142403a0134409658dc9760a)] --------- **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** Update DeltaCommits API - Change getCommits api to use json payload for its parameters. This is the method actually used by Delta Spark - Rename CoordinatedCommits to DeltaCommits in API **Related issue** unitycatalog#1143 --------- Signed-off-by: Yi Li <[email protected]>
## 🥞 Stacked PR Use this [link](https://github.com/unitycatalog/unitycatalog/pull/1169/files) to review incremental changes. - [**stack/commit_backfill_delete_meta**](unitycatalog#1169) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1169/files)] - [stack/commit_get](unitycatalog#1170) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1170/files/eee17f0c3f9e6a456523fb0bf502b560a31ddea7..6e1ceb0c6747f1c85bc344b25b6d982dc964a8b3)] - [stack/commit_access_test](unitycatalog#1178) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1178/files/6e1ceb0c6747f1c85bc344b25b6d982dc964a8b3..7cb3ace271839563449be4a900f5260633c423b5)] - [stack/ccv2_spark](unitycatalog#1186) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1186/files/7cb3ace271839563449be4a900f5260633c423b5..72eff6e86a48ecdcddbd407a5d7f5edabad35a7c)] --------- **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** This commit implements backfill and metadata update functionality for Delta commits in Unity Catalog: - Backfilling and deletion of old commit metadata - Commit limit enforcement - Table metadata updates via commits - Comprehensive test coverage **Related issue** unitycatalog#1143 --------- Signed-off-by: Yi Li <[email protected]>
## 🥞 Stacked PR Use this [link](https://github.com/unitycatalog/unitycatalog/pull/1170/files) to review incremental changes. - [**stack/commit_get**](unitycatalog#1170) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1170/files)] - [stack/commit_access_test](unitycatalog#1178) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1178/files/2170d0bcd2ae26a70bd10d094cf20f968d929874..b9bd7194e2bda546e69e8782cba3da95e1b4c83d)] - [stack/ccv2_spark](unitycatalog#1186) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1186/files/b9bd7194e2bda546e69e8782cba3da95e1b4c83d..1deff5e7a5805b9b1da01e8111a48ba1b8c09216)] --------- **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** This commit adds the ability to retrieve commits for managed Delta tables with coordinated commit semantics, completing the read path for the coordinated commits API. Key features: - Version range filtering (inclusive start and end) - Returns commits in descending order (newest first) - Returns latestTableVersion even when commit list is empty - Proper error handling for invalid parameters **Related issue** unitycatalog#1143 Signed-off-by: Yi Li <[email protected]>
🥞 Stacked PR
Use this link to review incremental changes.
PR Checklist
docsis updatedDescription of changes
This commit adds the ability to retrieve commits for managed Delta tables with coordinated commit semantics, completing the read path for the coordinated commits API.
Key features:
Related issue
#1143