Yibo-Dong opened a new issue, #19195: URL: https://github.com/apache/iceberg/issues/19195
### Apache Iceberg version 1.12.0 (latest release) ### Query engine Spark ### Please describe the bug 🐞 After a partition field is only renamed (`REPLACE PARTITION FIELD p WITH p AS p_renamed`), a dynamic `INSERT OVERWRITE` keeps the old rows of the overwritten partition and adds the new rows next to them. Reproduced on `main` (9d4f6c7, 2026-11-28) and 1.12.0, Spark 3.5.5. ### Reproduction ```sql SET spark.sql.sources.partitionOverwriteMode=dynamic; CREATE TABLE local.db.t (id INT, p STRING) USING iceberg PARTITIONED BY (p); INSERT INTO local.db.t VALUES (1, 'a'), (2, 'b'); ALTER TABLE local.db.t REPLACE PARTITION FIELD p WITH p AS p_renamed; INSERT OVERWRITE local.db.t SELECT 9, 'a'; SELECT 'renamed', collect_list(id) FROM (SELECT id FROM local.db.t ORDER BY id); -- control: no rename CREATE TABLE local.db.c (id INT, p STRING) USING iceberg PARTITIONED BY (p); INSERT INTO local.db.c VALUES (1, 'a'), (2, 'b'); INSERT OVERWRITE local.db.c SELECT 9, 'a'; SELECT 'control', collect_list(id) FROM (SELECT id FROM local.db.c ORDER BY id); ``` ### Expected | Query | Result | |---|---| | `renamed` | `[2,9]` | | `control` | `[2,9]` | ### Actual | Query | Result | |---|---| | `renamed` | `[1,2,9]` | | `control` | `[2,9]` | ### 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]
