laskoviymishka opened a new issue, #785:
URL: https://github.com/apache/iceberg-go/issues/785
### Feature Request / Improvement
Implement `CommitTransaction()` on the REST catalog, satisfying the
`TransactionalCatalog` interface.
## Wire Format
```
POST /v1/{prefix}/transactions/commit
Content-Type: application/json
{
"table-changes": [
{
"identifier": { "namespace": ["db"], "name": "t1" },
"requirements": [
{ "type": "assert-table-uuid", "uuid": "..." },
{ "type": "assert-ref-snapshot-id", "ref": "main", "snapshot-id":
123 }
],
"updates": [
{ "action": "add-snapshot", ... },
{ "action": "set-snapshot-ref", ... }
]
},
{
"identifier": { "namespace": ["db"], "name": "t2" },
"requirements": [ ... ],
"updates": [ ... ]
}
]
}
Response: 204 No Content
```
## Error Handling
| Status | Error | Meaning |
|--------|-------|---------|
| 404 | `ErrNoSuchTable` | A referenced table doesn't exist |
| 409 | `ErrCommitFailed` | One or more requirements failed — entire
transaction rejected |
| 500, 502, 504 | `ErrCommitStateUnknown` | Server error — commit may or may
not have been applied |
| 503 | `ErrCommitStateUnknown` | Service unavailable |
On 409, **no tables are modified** — all-or-nothing semantics.
## Implementation Notes
- Reuse existing `doPostAllowNoContent` helper with `allowNoContent=true`
(expects 204)
- Same error mapping pattern as `CommitTable` (`rest.go:828-835`)
- JSON field name on the wire is `"table-changes"` (kebab-case, matching
Java's `CommitTransactionRequestParser`)
- Each entry in `table-changes` reuses the existing `identifier`,
`requirements`, and `updates` serialization
- No response body to parse
- No retry logic built in (matches Java behavior — retries are the caller's
responsibility)
## Validation
- `commits` list must not be empty
- Every commit must have a non-nil `Identifier` (unlike single-table commit
where the identifier is in the URL path)
## References
- [Iceberg REST OpenAPI
spec](https://github.com/apache/iceberg/blob/main/open-api/rest-catalog-open-api.yaml)
- [Java
`CommitTransactionRequest`](https://github.com/apache/iceberg/blob/main/core/src/main/java/org/apache/iceberg/rest/requests/CommitTransactionRequest.java)
- [Java
`CommitTransactionRequestParser`](https://github.com/apache/iceberg/blob/main/core/src/main/java/org/apache/iceberg/rest/requests/CommitTransactionRequestParser.java)
## Depends On
- `TransactionalCatalog` interface and `TableCommit` type
https://github.com/apache/iceberg-go/issues/784
--
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]