feat(btree): refactor GlobalIndexScan & add inte test for btree global index#262
Open
lszskye wants to merge 1 commit intoalibaba:mainfrom
Open
feat(btree): refactor GlobalIndexScan & add inte test for btree global index#262lszskye wants to merge 1 commit intoalibaba:mainfrom
lszskye wants to merge 1 commit intoalibaba:mainfrom
Conversation
lxy-9602
reviewed
May 6, 2026
lxy-9602
reviewed
May 6, 2026
| auto offset_reader = std::make_shared<OffsetGlobalIndexReader>(fake_reader, 10); | ||
| // FakeGlobalIndexReader returns error for VectorSearch | ||
| ASSERT_NOK_WITH_MSG(offset_reader->VisitVectorSearch(nullptr), | ||
| "FakeGlobalIndexReader does not support vector search"); |
Collaborator
There was a problem hiding this comment.
Test vector search in OffsetGlobalIndexReaderTest, as it has different logic.
Also test for nullptr inner result.
lxy-9602
reviewed
May 6, 2026
lxy-9602
reviewed
May 6, 2026
lxy-9602
reviewed
May 6, 2026
| ASSERT_OK_AND_ASSIGN(auto result, union_reader.VisitVectorSearch(nullptr)); | ||
| ASSERT_FALSE(result); | ||
| } | ||
|
|
Collaborator
There was a problem hiding this comment.
add normal case for vector search.
lxy-9602
reviewed
May 6, 2026
lxy-9602
reviewed
May 6, 2026
| } | ||
| // TODO(lisizhuo.lsz): add executor in UnionGlobalIndexReader | ||
| readers.push_back(std::make_shared<UnionGlobalIndexReader>(std::move(union_readers), | ||
| /*executor=*/nullptr)); |
Collaborator
There was a problem hiding this comment.
Add executor for UnionGlobalIndexReader. May add param in GlobalIndexScan::Create().
lxy-9602
reviewed
May 6, 2026
lxy-9602
reviewed
May 6, 2026
lxy-9602
reviewed
May 6, 2026
lxy-9602
reviewed
May 6, 2026
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: #38
Introduce:
OffsetGlobalIndexReader: wraps anyGlobalIndexReaderand rewritesthe row ids in its results by adding a fixed offset. This is how local
row ids become global row ids.
UnionGlobalIndexReader: wraps a list ofGlobalIndexReaders andunions their results via
GlobalIndexResult::Or. It can run sub-readersin parallel through an
Executor, or sequentially when no executor isgiven.
Add inte test for btree global index
Tests
GlobalIndexTest