Repository navigation
[spark] Narrow cached source columns in shared Data Evolution MERGE joins - #11496
Open
JustinBinber wants to merge 6 commits into
Open
JustinBinber wants to merge 6 commits into
JustinBinber wants to merge 6 commits into
Conversation
JingsongLi
reviewed
Nov 28, 2026
JingsongLi
left a comment
Contributor
There was a problem hiding this comment.
I ran all 19 narrow-source MERGE tests on Spark 3.5.9 and all 19 on Spark 4.1.4. The optimization addresses the measured shuffle and disk-cache cost for wide INSERT payloads. An additional Spark 4.1.4 SQL test reproduced a result change for cached source tables.
2 tasks done
JingsongLi
reviewed
Nov 29, 2026
JingsongLi
left a comment
Contributor
There was a problem hiding this comment.
The 22 focused Spark cases passed. A separate MERGE reproduction failed when narrowing pinned a source with reader-level latest-delta options.
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.
Fixes #11323
Follow-up to #11322
@JingsongLi, thank you for rerunning the 17 MERGE tests on Spark 3.5.9 and 4.1.4 and for reproducing the same-ID rollback case in your review. This resubmission carries forward the fix discussed there and is based on a fresh
mastersnapshot.Behavior and benchmark
The default-off option keeps INSERT-only wide columns out of the shared join cache. Eligible Paimon append sources are pinned, and INSERT rereads the source with null-safe key membership. The reread still scans the source. Unsupported sources and plans fall back to the existing shared path.
On the fixed wide-field workload with about 90% INSERT, existing sharing versus narrowing used 316.79 vs 10.77 MB of shuffle and 312.20 vs 18.78 MB peak disk cache. Full SQL took 76.95 vs 72.63 s, with sampled RSS rising from 3.78 to 4.80 GiB. These are one-sample screening measurements per configuration on a single host, from the earlier feature revision. The public reproduction bundle includes SQL, input generation, results, and the all-INSERT and no-wide-field controls.
Validation
CI passed on the prior fixed revision. The regression suite includes rollback with a reused ID and schema and fallback for sources that skip unavailable files. This revision has its own CI run.
The full 19-test regression suite also passed locally on Linux with Spark 3.5.9, Scala 2.13, and Temurin 8 on this revision.