Conversation
litiliu
marked this pull request as draft
September 20, 2026 06:38
litiliu
force-pushed
the
feature/update-if-changed-merge-engine
branch
7 times, most recently
from
September 20, 2026 10:03
9ebf163 to
5da67ad
Compare
litiliu
force-pushed
the
feature/update-if-changed-merge-engine
branch
from
September 21, 2026 03:22
5da67ad to
5a7eec9
Compare
litiliu
marked this pull request as ready for review
September 21, 2026 06:05
Contributor
Author
|
@luoyuxia PTAL, when you have time thanks! |
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.
Summary
Introduce an
UPDATE_IF_CHANGEDmerge engine for primary-key tables ('table.merge-engine' = 'update_if_changed').It keeps last-row upsert semantics but suppresses value-identical writes:
Equality is based on logical field values, not raw bytes: null values use logical equality, binary values are compared by content, and rows from different schema versions are aligned to the latest schema by stable column IDs. Fields that exist in the latest schema but are absent from either compared row are treated as null. Partial updates and partial deletes are first applied to the stored row to produce a complete candidate row, which is then compared with the stored row.
Because it must read the stored value before deciding, it does not use the WAL full-row fast path that skips old-value lookup (the merger is not a
DefaultRowMerger, socanSkipOldValueLookupstays false).Fixes #4343
Changes
MergeEngineType.UPDATE_IF_CHANGED+fromStringand config descriptionUpdateIfChangedRowMerger, supporting full-row, partial-update, and partial-delete mutations with logical row equality, wired intoRowMerger.create()FlinkTableSink: allow partial updates and UPDATE/DELETE for this engineTest Plan
UpdateIfChangedRowMergerTestandRowMergerCreateTest(unit: logical equality, schema alignment, full-row and partial mutations, and merger creation)FlussTableITCase#testUpdateIfChangedMergeEngine(end-to-end: value-identical full-row upserts emit no changelog record while changes and deletes do)FlussTableITCase#testUpdateIfChangedMergeEngineWithPartialUpdate(end-to-end: value-identical partial updates/deletes are no-ops while changed mutations emit changelog records)FULLandWALchangelog imagesFlinkTableSinkITCase#testUpdateIfChangedMergeEngineSupportsMutations(Flink sink integration: partial INSERT, UPDATE, and DELETE)🤖 AI-assisted changes - reviewed by human developer