Core, Data, Spark: Build equality delete map once per task#16956
Open
kinolaev wants to merge 2 commits into
Open
Core, Data, Spark: Build equality delete map once per task#16956kinolaev wants to merge 2 commits into
kinolaev wants to merge 2 commits into
Conversation
Signed-off-by: Sergei Nikolaev <kinolaev@gmail.com>
singhpk234
reviewed
Jun 24, 2026
singhpk234
left a comment
Contributor
There was a problem hiding this comment.
wonder if you tried this already
#9563 ?
Author
|
Hi @singhpk234 , I didn't try it, because I have only one big executor. |
04fb43d to
ffb8a8d
Compare
Signed-off-by: Sergei Nikolaev <kinolaev@gmail.com>
ffb8a8d to
d8c181c
Compare
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.
Equality delete files can be referenced by many data files. This PR allows to accumulate all equality deletes of a table snapshot in the structure
spec id -> partition -> equality field ids -> equality key -> max data sequence numberthat can be reused for many data files. If passed toDeleteFilter, it fills the structure lazily.I added shared equality deletes to Spark's
RowDataReaderandBatchDataReaderby default, because the size of the shared structure is bounded by split size (multiplied by compression rate). ToGenericReaderI added a boolean parametershareEqDeleteswhich is false by default, because the size is unbounded, and switching the parameter to true might cause OOMs. And I don't use Flink, so I hesitated to propose changing its behavior.The non-shared
DeleteFilterpath is unchanged, so Flink and other engines are byte-for-byte identical. The shared path produces identical results (equivalence covered by tests).Additionally, this PR changes task weight calculation algorithm - each delete file is accounted only once per bin even if it is referenced by several data files in that bin. This change can be moved into a separate PR if preferred.
In our case these changes reduced Spark memory consumption by 30-50% and, more important, prevented Spark from hanging for hours on building and evicting huge equality delete sets for each data file. For frequently updated tables (several thousands of equality delete files per day) ingested with Debezium Iceberg Sink
rewrite_data_filesexecution time is reduced from several hours to several minutes.Btw, I found that Trino uses a similar technique: EqualityDeleteFilter, DeleteManager.