feat: support real-time append writes and reads with pluggable memory indexers - #163
Draft
lxy-9602 wants to merge 4 commits into
Draft
feat: support real-time append writes and reads with pluggable memory indexers#163lxy-9602 wants to merge 4 commits into
lxy-9602 wants to merge 4 commits into
Conversation
lxy-9602
marked this pull request as draft
August 1, 2026 04:37
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
Linked issue: #158
This PR introduces an opt-in real-time write and read framework for fixed-bucket append tables.
Applications can attach a shared
RealtimeContextto write and scan contexts. Writes are buffered bya pluggable
MemIndexerand become queryable before snapshot commit. During prepare commit, thecurrent memory segment is sealed and flushed through Paimon's existing rolling writer, while later
writes continue in a new segment.
The read path captures an immutable memory view and combines it with the latest committed disk
snapshot through
RealtimeSplit. The append reader concatenates disk and memory readers, usingper-partition-bucket
_OFFSETprogress to avoid duplicate or missing rows.The main changes are:
MemIndexerandMemIndexerFactoryinterfaces.RealtimeContextfor sharing memory indexers between writers and readers.PrepareCommitWithProgressandCommitWithProgress.metadata/<uuid>.offsetsfiles.RefreshCommittedSnapshotto reclaim sealed memory covered by committed disk data.The current implementation supports streaming writes and latest-snapshot batch scans for fixed-bucket
append tables. Primary-key tables, deletion vectors, data evolution, streaming scans, scan-limit
pushdown, and global-index splits are not included in this PR.
Tests
Added unit coverage for:
Added 14 integration tests covering:
_OFFSETvalues;API and Format
This PR adds the following public API concepts:
RealtimeContextMemIndexer,MemIndexerFactory, andMemReadViewRealtimeWriteBatchandRealtimeCommitProgressWriteContextBuilder::WithRealtimeContextScanContextBuilder::WithRealtimeContextFileStoreWrite::PrepareCommitWithProgressFileStoreWrite::RefreshCommittedSnapshotFileStoreCommit::CommitWithProgressThe feature is opt-in through
RealtimeContext; existing write, commit, and disk-only read paths areunchanged when no real-time context is supplied.
Real-time data files contain the reserved
_OFFSETfield. Each committed snapshot references aversioned offsets file containing the latest offset for every partition-bucket. Data files and
offset progress are published atomically by the same snapshot commit.
Real-time commits currently fail directly on snapshot conflicts. Failure recovery and idempotent
retry will be handled separately.
Documentation
Generative AI tooling
Generated-by: OpenAI Codex (GPT-5)