andreacfm opened a new issue, #9024: URL: https://github.com/apache/iceberg/issues/9024
### Apache Iceberg version 1.4.1 ### Query engine Spark ### Please describe the bug 🐞 When executing a “merge into” query the source data is committed even if not matched by any of query clause. Consider the following existing table: ``` id | name 1 | Andrea 2 | Luigi 3 | John 4 | Steve ``` And a a temp view like: ``` id | name 3 | John 4 | Steve ``` The MERGE INTO query looks like following: ``` MERGE INTO default.people p USING (SELECT * from view) v ON p.id = v.id WHEN MATCHED AND p.name != v.name THEN UPDATE SET * WHEN NOT MATCHED THEN INSERT * ``` The query should not do nothing but the data coming from the temp view is still committed to file. The commit is skipped if `write.merge.mode=merge-on-read` but it should not happen also when on `cow` mode. -- 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: issues-unsubscr...@iceberg.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org