apache / apache/iceberg-python

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

未关闭
#3,076 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
1.1k
派生
581
平均合并
1 天 17 小时
30 天内合并 PR
78

描述

### 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 方法中的两次 .update_snapshot() 调用,以及周围的事务行为;当 catalog 拒绝每个事务包含多个快照时,pyiceberg 仍能可靠地提交兼容操作,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
databases
Issue 类型
缺陷
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。