Repository navigation
feat(table): maintain declared global indexes after writes - #1261
Merged
Merged
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.
Purpose
Maintain declared global indexes synchronously after append/Data Evolution writes when
write-only=false, so callers do not need a separate index build after each write.Brief change log
global-index.<family>.index-columns) and per-column native options. Reuse the existing scalar, full-text and vector builders.auto_index. Shared planning captures and filters one immutable index view; concrete builders use that view for both coverage calculation and overlap validation.Data, compaction and index publication are separate transactions because global row IDs must be assigned before indexing. An index failure leaves the data committed; retrying with the same commit user and identifier resumes maintenance.
Tests
cargo test --locked -p paimon --all-targets --features vortex— passed; core unit tests: 4728 passed, 6 ignored.cargo +1.98.0 clippy --locked --all-targets --workspace --features vortex -- -D warnings— passed.cargo +1.98.0 fmt --all -- --check— passed.Regression coverage includes CAS conflicts, uncertain publication, concurrent recovery, append/overwrite/manual compaction recovery, stale REST committers, FULL/DETAIL fallback with no or partial coverage, manual builder defaults/overrides, and vector algorithm/metric changes with interrupted publication and replay.
Filtered-view regression tests cover BTree, full-text and vector builders: captured snapshots stay fixed, only the selected gap is rebuilt, unrelated coverage and overlap guards remain intact, and building does not alter published references or historical files.
API and Format
New table options declare automatically maintained indexes. Maintenance runs with
write-only=false(the default) only when indexes are declared;write-only=trueskips automatic maintenance. Supported tables have row tracking, no primary key andbucket=-1.Existing global-index builders, payload formats and index manifests are reused. Primary-key index maintenance is outside this change.
Documentation
Update the compaction and SQL guides with declarations, option precedence, definition replacement, and recovery APIs.