feat(scan): support built-in global index search during scan process#23
Merged
Conversation
lxy-9602
reviewed
Dec 19, 2025
lxy-9602
reviewed
Dec 19, 2025
lxy-9602
reviewed
Dec 19, 2025
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the scan operation to natively support global index lookups in two ways: (1) utilizing precomputed index results provided by distributed queries, and (2) automatically evaluating scan predicates against global indexes during the scan process when enabled. The implementation introduces a new DataEvolutionBatchScan wrapper that orchestrates global index evaluation and integrates results into the scan pipeline.
Key changes:
- Introduces
DataEvolutionBatchScanto wrapDataTableBatchScanand handle global index integration - Refactors
ScanContextto useGlobalIndexResultinstead of rawstd::vector<Range>for row ranges - Adds
Range::Exclude()utility for computing non-indexed ranges andGlobalIndexResult::ToRanges()for conversion
Reviewed changes
Copilot reviewed 58 out of 58 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/paimon/core/table/source/data_evolution_batch_scan.cpp |
New class implementing built-in global index scan with automatic evaluation and result merging |
src/paimon/core/global_index/global_index_scan_impl.cpp |
Adds ParallelScan method for concurrent index evaluation across ranges |
src/paimon/core/operation/scan_context.cpp |
Changes ScanContext to accept GlobalIndexResult instead of raw row ranges |
src/paimon/common/utils/range.cpp |
Implements Range::Exclude() to compute complement ranges |
src/paimon/common/global_index/global_index_result.cpp |
Adds ToRanges() to convert bitmap results to range vectors |
test/inte/global_index_test.cpp |
Refactors tests to use new ScanGlobalIndexAndData helper and adds comprehensive scan integration tests |
src/paimon/core/core_options.cpp |
Adds global-index.enabled option (default true) to control feature enablement |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lucasfang
reviewed
Dec 22, 2025
lucasfang
approved these changes
Dec 22, 2025
Collaborator
|
+1 |
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
feat(scan): support built-in global index lookup during scan
This PR enhances the scan operation to natively support global index lookups in two ways:
Index-driven scan: When a distributed query provides precomputed index results, the scan can directly utilize these results to fetch only the relevant data, significantly reducing I/O overhead.
Built-in scan: During the scan process, if global index search is enabled and applicable global indexes exist, the system automatically evaluates the scan predicates, uses them to query the relevant global index first, and then retrieves only the corresponding data.
Linked issue: #5
Tests
GlobalIndexTest