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

   ### Apache Iceberg version
   
   1.12.0 (latest release)
   
   ### Query engine
   
   Spark
   
   ### Please describe the bug 🐞
   
   After a v2 table is upgraded to v3, `rewrite_position_delete_files` writes a 
DV per data file from the delete files it selected. Delete files of the same 
data file that were not selected stay, but readers ignore them once a DV 
exists, so their deleted rows come back. Reproduced on `main` (9d4f6c7, 
2026-11-28) and 1.12.0, Spark 3.5.5.
   
   ### Reproduction
   
   ```sql
   -- v2 table: one data file, three position delete files (two small, one 
larger)
   CREATE TABLE local.db.t (id INT, p INT) USING iceberg PARTITIONED BY (p)
     TBLPROPERTIES ('format-version'='2', 'write.delete.mode'='merge-on-read', 
'write.delete.granularity'='partition');
   INSERT INTO local.db.t SELECT id, 1 FROM range(0, 2000) AS r(id);
   DELETE FROM local.db.t WHERE id = 1;
   DELETE FROM local.db.t WHERE id = 2;
   DELETE FROM local.db.t WHERE id >= 1000;
   SELECT 'before', count(*) FROM local.db.t;
   ALTER TABLE local.db.t SET TBLPROPERTIES ('format-version'='3');
   -- only the two small delete files are selected
   CALL local.system.rewrite_position_delete_files(table => 'db.t', options => 
map(
     'min-input-files', '2', 'min-file-size-bytes', '2500', 
'max-file-size-bytes', '1000000', 'target-file-size-bytes', '100000'));
   SELECT 'after', count(*) FROM local.db.t;
   ```
   
   ### Expected
   
   | Query | Result |
   |---|---|
   | `before` | `998` |
   | `after` | `998` |
   
   ### Actual
   
   | Query | Result |
   |---|---|
   | `before` | `998` |
   | `after` | `1998` (rows 1000..1999 are 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
   - [ ] 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