apache / apache/iceberg-python

Databricks Iceberg REST catalog doesn't support multiple snapshots per transaction

オープン
#3,076 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
1.1k
フォーク
581
平均マージ
1日 17時間
マージ済み PR(30日)
77

説明

### Apache Iceberg version

0.10.0 (latest release)

### Please describe the bug 🐞

When connecting with the databricks / unity iceberg REST catalog to write data using pyiceberg, commits fail at `.commit_transaction()` if the transaction contains several snapshots:
`pyiceberg.exceptions.CommitFailedException: CommitFailedException: Failed to commit to the table, requirement failed: Adding multiple snapshots in a single update is not supported.`

This is tricky, since some of the higher-level operations use transactions, but also the "primitives" can fail if a delete happens to contain 2 snapshots (`.update_snapshot()` is called in two places in the delete method).
However these failures might not appear on the happy path but only if eg another writer process has modified the table and the pyiceberg writer then fails because that triggers two snapshots in a transaction

Assuming databricks doesn't intend to bring multi-snapshot transactions into their iceberg rest catalog, would it be possible to add full "autocommit" support to pyiceberg, such that each snapshot can get committed indiviudually?
The transactions would loose their point, but at least one can then again use pyiceberg with unity's iceberg rest reliably

Steps to reproduce:
- Connect to Databricks iceberg REST using pyiceberg
- Open a transaction
- perform operations that generate 2 or more snapshots
- Attempt commit

### Willingness to contribute

- [ ] I can contribute a fix for this bug independently
- [ ] I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- [x] I cannot contribute a fix for this bug at this time

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

複数のスナップショットを含むトランザクションを使って、Databricks または Unity Iceberg REST catalog に対してまず失敗を再現します。.commit_transaction()、delete メソッド内の 2 つの .update_snapshot() 呼び出し、および周辺のトランザクション動作を追跡します。catalog が 1 トランザクションあたり複数のスナップショットを拒否する場合でも、pyiceberg が互換性のある操作を確実に commit できれば完了とします。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
databases
issue の種類
バグ
難易度
5/5
見積もり時間
1週間以上
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。