steveis opened a new pull request, #2786:
URL: https://github.com/apache/iceberg-rust/pull/2786
## Which issue does this PR close?
- Closes #2784.
## What changes are included in this PR?
Client support for the REST spec's `POST /v1/{prefix}/transactions/commit`
(atomic multi-table commits):
- `Transaction::prepare_commit()` — runs the transaction's actions against
its base table and returns the resulting `TableCommit` without sending it, as
the per-table building block. Unlike `Transaction::commit`, it does not refresh
or retry; conflict handling across a transaction group belongs to the caller
(documented).
- `CommitTransactionRequest` wire type (`table_changes:
Vec<CommitTableRequest>`) — `CommitTableRequest` already documented that
`identifier` must be present for this request.
- `RestCatalog::commit_transaction(Vec<TableCommit>)` — submits the group;
HTTP 409 maps to a retryable `CatalogCommitConflicts` error, other statuses
mirror `update_table`'s handling. An empty commit list is a no-op that does not
contact the server.
Kept on `RestCatalog` rather than the `Catalog` trait since multi-table
atomicity is a catalog capability, not a universal guarantee — happy to discuss
trait-level capability exposure as a follow-up.
Use case: a Postgres→Iceberg CDC producer committing per-cadence row deltas
to many tables plus a changelog table, atomically. Validated end-to-end against
Lakekeeper (which implements the endpoint): two tables, one commit, changes
visible on both or neither.
## Are these changes tested?
Unit tests: `prepare_commit` produces the expected updates/requirements
without a catalog and errors on an empty transaction; mockito-based REST tests
for the happy path (body carries `table-changes` for both tables), 409 →
retryable conflict, and the empty no-op. `cargo test -p iceberg --lib` (1385)
and `cargo test -p iceberg-catalog-rest --lib` (47) pass.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]