Yibo-Dong opened a new issue, #19304:
URL: https://github.com/apache/iceberg/issues/19304

   ### Apache Iceberg version
   
   main (development)
   
   ### Query engine
   
   Spark
   
   ### Please describe the bug 🐞
   
   Cherry-picking a dynamic partition overwrite is allowed only if the replaced 
partitions were not changed since its parent. A merge-on-read `DELETE` in that 
partition is not detected, so the cherry-pick succeeds and the deleted row 
comes back. With a copy-on-write `DELETE` the cherry-pick is rejected. Same 
with format-version 3 (deletion vectors). Reproduced on `main` (3bfa3e4, 
2026-12-01) and 1.12.0, Spark 3.5.5.
   
   ### Reproduction
   
   `<b_head>` is `SELECT snapshot_id FROM local.db.t.refs WHERE name = 'b'`.
   
   ```sql
   SET spark.sql.sources.partitionOverwriteMode=dynamic;
   CREATE TABLE local.db.t (id INT, p INT) USING iceberg PARTITIONED BY (p)
     TBLPROPERTIES ('format-version'='2', 'write.delete.mode'='merge-on-read');
   INSERT INTO local.db.t VALUES (1, 1), (2, 1);
   ALTER TABLE local.db.t CREATE BRANCH b;
   INSERT OVERWRITE local.db.t.branch_b VALUES (1, 1), (2, 1), (3, 1);
   DELETE FROM local.db.t WHERE id = 2;
   CALL local.system.cherrypick_snapshot('db.t', <b_head>);
   SELECT id FROM local.db.t ORDER BY id;
   ```
   
   ### Expected
   
   | Query | Result |
   |---|---|
   | `cherrypick_snapshot` | rejected: `Cannot cherry-pick replace partitions 
with changed partition: PartitionData{p=1}` (as with 
`'write.delete.mode'='copy-on-write'`) |
   | `SELECT id` | `1` |
   
   ### Actual
   
   | Query | Result |
   |---|---|
   | `cherrypick_snapshot` | succeeds |
   | `SELECT id` | `1`, `2`, `3` (deleted row `2` is back) |
   
   
   ### 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


-- 
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]

Reply via email to