kccrcodes opened a new pull request, #19132: URL: https://github.com/apache/iceberg/pull/19132
Merge-on-read `DELETE`, `UPDATE` and `MERGE` fail after a partition field and its source column are dropped, because `_partition` no longer carries that field and `SparkPositionDeltaWrite` cannot project the old spec's tuple. Taking the tuple from data file metadata doesn't work either: the field's type is now `unknown`, so new delete manifests store `null` and later reads fail with "metadata is corrupted". This PR therefore makes row-level operations fall back to copy-on-write, with a warning, while live data files remain in such specs. The delta writer only builds projections for specs it can project. Closes #19117 Test plan: new `TestUpdate`, `TestDelete` and `TestMerge` cases run under copy-on-write and merge-on-read for format v2 and v3, and fail on `main` for merge-on-read. `TestMergeOnReadUpdate` checks that merge-on-read resumes once the old files are rewritten. --- **AI Disclosure** - Model: Grok - Platform/Tool: Grok - Human Oversight: Grok was used to help investigate the issue and draft the code and tests; the author reviewed and tested the change. - Prompt Summary: Investigate #19117, reproduce it with regression tests, and draft a fix for Spark 4.2. -- 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]
