[core][WIP] Avoid global index rebuilds for unrelated column compaction - #9069
Draft
leaves12138 wants to merge 3 commits into
Draft
[core][WIP] Avoid global index rebuilds for unrelated column compaction#9069leaves12138 wants to merge 3 commits into
leaves12138 wants to merge 3 commits into
Conversation
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
long[]of per-column maximum sequence numbers toDataFileMeta.writeColsto resolve array positions; full-column files use the file schema field order.Why
Data-evolution compaction rewrites a full normal data file. Today the compacted file's overall
maxSequenceNumberadvances when only a non-index column changes, soSortedGlobalIndexScannertreats the row range as an index-column update and rebuilds the global index unnecessarily.Snapshot history cannot reliably answer which column changed because snapshots may already have expired. Persisting the column watermarks in file metadata makes the decision independent of retained snapshot history and lets repeated compactions carry the information forward.
Compatibility
DataFileMetalayout.DataFileMetamethods as default methods so existing external implementations remain source/binary compatible.CommitMessage,DataSplit,IncrementalSplit,ChainSplit, andSplitSerializer.sys.copyassigns a target schema id, clear the positional sequence array so readers conservatively fall back to the file-level maximum.Impact
For data-evolution tables using global-index column update action
IGNORE, compaction after updating only non-index columns no longer rebuilds an already valid global index. Updates to indexed columns still trigger refresh. Legacy files remain conservative.Checks
paimon-coretests, including historicalDataSplitandManifestCommittablecompatibility resourcesSortedGlobalIndexScannerTestwith non-index updates, repeated compaction, and expired snapshotsChangelogCompactTaskSerializerTestwith column sequence metadataCopyFilesUtilTestThis is a WIP draft for design and compatibility review.