[SPARK-55948][SQL][FOLLOWUP] Clarify rowVersion contract in DSv2 Changelog interface#55460
Closed
gengliangwang wants to merge 3 commits intoapache:masterfrom
Closed
[SPARK-55948][SQL][FOLLOWUP] Clarify rowVersion contract in DSv2 Changelog interface#55460gengliangwang wants to merge 3 commits intoapache:masterfrom
gengliangwang wants to merge 3 commits intoapache:masterfrom
Conversation
Redefine rowVersion as the commit at which the row's content was last modified: assigned on insert, bumped on update, and preserved when the row is rewritten by a copy-on-write operation without a content change. This makes rowVersion distinct from _commit_version and lets Spark distinguish copy from update by a scalar comparison instead of full-row equality. Also broaden rowId's Javadoc to cover carry-over removal and extend the override requirement to include containsCarryoverRows(). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Member
Author
|
cc @johanl-db @SanJSp as well |
2 tasks
SanJSp
reviewed
Apr 22, 2026
SanJSp
reviewed
Apr 22, 2026
SanJSp
reviewed
Apr 22, 2026
SanJSp
left a comment
There was a problem hiding this comment.
If we want to keep Javadoc changes in a PR, this could be a nice addition for this comment of yours #55426 (comment)
Co-authored-by: Sandro Sp <38314662+SanJSp@users.noreply.github.com>
Member
Author
|
@SanJSp Thanks, I have applied all your suggestions. |
viirya
approved these changes
Apr 22, 2026
Member
Author
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.
What changes were proposed in this pull request?
Refine the Javadoc for two methods on the DSv2
Changeloginterface introduced in SPARK-55948:rowVersion()— redefined as the commit at which the row's content was last modified: assigned on initial insert, bumped on update, and preserved when the row is rewritten by a copy-on-write operation without a content change. The previous Javadoc described it as an "ordering column", which invited implementers to set it equal to_commit_version.rowId()— extended the "must override" condition to includecontainsCarryoverRows(), matching the fact that the column is used for carry-over removal in addition to update detection and net change computation.Documentation only; no code behavior changes.
Why are the changes needed?
When
rowVersionis conflated with_commit_version, both halves of a delete+insert pair always carry the same value, so row-version equality cannot discriminate a copy-on-write carry-over from a real update. Post-processing is then forced into full-row equality checks — slower, and incorrect in the edge case where a real update happens to rewrite a row to identical values (it would be silently dropped as a carry-over).With the clarified contract, carry-over detection becomes a scalar comparison: within a
(rowId, _commit_version)group, equalrowVersion⇒ copy, differentrowVersion⇒ real update.Does this PR introduce any user-facing change?
No. Javadoc only.
How was this patch tested?
N/A — documentation only.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 4.7