riverandeye opened a new pull request, #2779: URL: https://github.com/apache/iceberg-go/pull/2779
Closes #2778 ## What A copy-on-write `Delete` or filtered `Overwrite` used to rewrite every file whose metrics might match the filter, even when no row matched. That produced an identical copy of the file plus a snapshot that removed and re-added it. `rewriteFilesWithFilter` now checks each candidate file first. It scans the file with the delete filter, applying the file's existing deletes, projecting only the filter columns, with a row limit of 1. If nothing comes back, the file is kept as is: - no rewrite, no `removeDataFile` / `appendDataFile` - its position deletes, deletion vector, and equality deletes stay live - it is no longer passed to the concurrent-delete validator, so a concurrent delete against it does not fail the commit When no file changes, the commit is the same empty snapshot that a filter matching no file's metrics already produces. Java and Spark also commit an empty snapshot for a delete that matches nothing. ## Tests - `TestCoWRewriteKeepsFilesWithoutMatchingRows`: value inside the bounds but absent (v2, v3), and the only matching row already removed by a position delete, a DV, or an equality delete. Covers both copy-on-write delete and filtered overwrite. The file path and its delete files are unchanged. - `TestCoWRewriteOnlyRewritesFilesWithMatchingRows`: two candidate files, and only the one with a matching row is replaced. - `TestCopyOnWriteConflict_ConcurrentDeleteOnKeptFileCommits`: a concurrent merge-on-read delete against a kept file no longer fails the commit. - `TestCopyOnWriteDeleteKeepsRowsWhereFilterIsNull/and`: this filter matches no row, so the assertion that the file was rewritten now expects no file changes. All the new cases fail on main. -- 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]
