[paimon] Fix union read paimon dv table issue #2326
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: close #2121
The pr fixes the union read functionality for Paimon tables with deletion vectors (DV) enabled.
The fix enables Flink to correctly perform union reads that combine data from both:
Brief change log
The basic idea is:
The full change log is as follows:
DvTableReadableSnapshotRetrieverto determine readable snapshots for DV tables by analyzingPaimon snapshot compaction history and L0 file status across all buckets/partitions
PaimonDvTableUtilswith utilities for working with Paimon DV tables, including partitionname conversion and bucket analysis
LakeCommitResultto represent lake commit results with readable snapshot information so that the fluss cluster can record itAdminAPI withgetReadableLakeSnapshot()method to retrieve readable snapshotsFlussTableLakeSnapshotCommitterto commit readable snapshot information along withtiered snapshots
Tests
Add
FlinkUnionReadDvTableITCasewith comprehensive integration tests:testUnionReadDvTable(): Tests union read on non-partitioned DV table with 3 bucketstestUnionReadDvPartitionedTable(): Tests union read on partitioned DV table with 2partitions × 2 buckets
Add
DvTableReadableSnapshotRetrieverTestwith unit tests covering:Add
PaimonDvTableUtilsTestfor utility function testingAPI and Format
New API:
Admin.getReadableLakeSnapshot(TablePath)- Returns a readable snapshot if oneexists, throws
LakeTableSnapshotNotExistExceptionotherwiseNew API:
Admin.getLakeSnapshotById(TablePath, long)- Retrieves a specific historicalsnapshot by ID
RPC Changes: Added new RPC methods for readable snapshot operations in
FlussApi.protoDocumentation