Spark: Add spark custom property for delete#15588
Closed
yingjianwu98 wants to merge 3 commits intoapache:mainfrom
Closed
Spark: Add spark custom property for delete#15588yingjianwu98 wants to merge 3 commits intoapache:mainfrom
yingjianwu98 wants to merge 3 commits intoapache:mainfrom
Conversation
ebyhr
reviewed
Mar 11, 2026
| String propertyKey = "test-key"; | ||
| String propertyValue = "session-value"; | ||
|
|
||
| // use a v1 table so that DELETE goes through SparkTable.deleteWhere() |
Member
There was a problem hiding this comment.
Is this comment correct? The deleteWhere method is called even with format-version 2 & 3 as far as I tested locally.
Contributor
Author
There was a problem hiding this comment.
Sorry was not clear here.
For v2 and v3, a full partition delete indeed go through this but a row level delete I believe will go through SparkPositionDeltaWrite, which doesn't have the same issue.
c408411 to
2db879f
Compare
Contributor
|
Hey @yingjianwu98 sorry I think there was actually an older PR (though not that much older) https://github.com/apache/iceberg/pull/15061/changes which addresses this. I think we should probably just get that one in? Would you be open to reviewing that? |
Contributor
Author
|
Thanks @amogh-jahagirdar Good call out, I will review that one instead! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In Spark, writes that go through SparkWrite (append, overwrite, dynamic overwrite) correctly populate custom snapshot properties via extraSnapshotMetadata. However, deletes that go through SparkTable.deleteWhere() (partition-level deletes on both v1 and v2 tables) do not apply these properties.
This PR fixes the inconsistency by having deleteWhere() also read and apply extraSnapshotMetadata from the session configuration.