feat(index): support distributed LabelList scalar index builds#7223
Open
jackye1995 wants to merge 1 commit into
Open
feat(index): support distributed LabelList scalar index builds#7223jackye1995 wants to merge 1 commit into
jackye1995 wants to merge 1 commit into
Conversation
LabelListIndexPlugin::train_index rejected fragment-scoped training, so a LabelList index could not be built through the distributed / segmented path (per-fragment execute_uncommitted + merge_existing_index_segments) the way BTree, Inverted, Bitmap, and FM already are. Build over the already fragment-scoped data stream (mirroring FMIndexPlugin) and add merge_label_list_indices, which unions the per-segment bitmap states and list_nulls row sets. Route LabelList segments through merge_existing_index_segments.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
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.
Summary
LabelListIndexPlugin::train_indexunconditionally rejected fragment-scopedtraining (
fragment_ids.is_some()), so a LabelList index could not be builtthrough the distributed / segmented path (per-fragment
execute_uncommitted+merge_existing_index_segments) the way BTree, Inverted, Bitmap, and FM alreadyare. This makes LabelList a first-class distributed scalar index.
Changes
lance-index/src/scalar/label_list.rs:train_indexignoresfragment_idsandbuilds over the already fragment-scoped stream (mirrors
FMIndexPlugin); a partialindex over a fragment subset is correct since it covers exactly those rows. Add
merge_label_list_indices, which unions the per-segment bitmap states and thelist_nullsrow sets. LabelList wraps aBitmapIndexplus a null-row set anddistributed segments cover disjoint rows, so this is a cheap union (the same
operation
LabelListIndex::updateperforms) — no source re-scan. Mirrorsmerge_bitmap_indicesbut also carrieslist_nulls.lance/src/index/scalar/label_list.rs(new):merge_segmentsopens each sourcesegment as a
LabelListIndexand callsmerge_label_list_indices(mirrorsscalar/bitmap.rs).lance/src/index.rs:merge_existing_index_segmentsroutesall_label_listsegments (details
LabelListIndexDetails) to the new merge; addsegment_has_label_list_details.lance/src/index/scalar.rs: declare thelabel_listmodule.Covered by
test_label_list_merge_existing_index_segments: one LabelList segment perfragment, merged via
merge_existing_index_segments, answersarray_has_anyacrossboth fragments with the same row count as a pre-index full scan.