feat(scan): support create index readers with field name during scan process#26
Merged
lxy-9602 merged 3 commits intoalibaba:mainfrom Dec 23, 2025
Merged
Conversation
lucasfang
previously approved these changes
Dec 22, 2025
There was a problem hiding this comment.
Pull request overview
This PR adds support for creating multiple index readers for a field by name during the scan process. The new API method CreateReaders(const std::string& field_name) complements the existing CreateReader method by returning all available index readers for a given field, regardless of index type.
Key Changes:
- Added public API method
CreateReaders(const std::string& field_name)to retrieve all index readers for a field - Refactored internal implementation to extract common logic into a private
CreateReaders(const DataField&)method - Added comprehensive test validating the new API with multiple index types (bitmap and lumina)
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| include/paimon/global_index/row_range_global_index_scanner.h | Added public virtual method CreateReaders(const std::string& field_name) with documentation |
| src/paimon/core/global_index/row_range_global_index_scanner_impl.h | Added public override for CreateReaders(const std::string&) and private helper CreateReaders(const DataField&) |
| src/paimon/core/global_index/row_range_global_index_scanner_impl.cpp | Implemented new public method and refactored existing CreateReaders(int32_t) to use common CreateReaders(const DataField&) helper |
| test/inte/global_index_test.cpp | Added TestScanIndexWithTwoIndexes test case verifying the new API works with bitmap and lumina indexes, and returns empty vector for non-indexed fields |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
feat(scan): support create index readers with field name during scan process
Purpose
Linked issue: #5
Tests
GlobalIndexTest
API and Format
virtual Result<std::vector<std::shared_ptr>> CreateReaders(const std::string& field_name) const = 0;