feat(index): support distributed LabelList scalar index builds#7223
Merged
jackye1995 merged 2 commits intoJun 29, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Xuanwo
reviewed
Jun 17, 2026
| )) | ||
| })?; | ||
| let scalar_index = | ||
| super::open_scalar_index(dataset, &field_path, segment, &NoOpMetricsCollector).await?; |
Collaborator
There was a problem hiding this comment.
This can silently convert legacy nullable LabelList segments into a current-format index.
Please reject merging nullable LabelList segments that are missing the list-null metadata, or rebuild from source data instead of writing them as current-format output.
Xuanwo
reviewed
Jun 17, 2026
| let mut source_indices = Vec::with_capacity(segments.len()); | ||
| let mut fragment_bitmap = RoaringBitmap::new(); | ||
| for segment in &segments { | ||
| fragment_bitmap |= segment.fragment_bitmap.as_ref().cloned().ok_or_else(|| { |
Collaborator
There was a problem hiding this comment.
This can publish stale coverage and row addresses when any source segment covers retired fragments.
Please compute effective live coverage and filter the merged bitmap state plus list_nulls, or rebuild from live fragments when deleted coverage is present.
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.
jackye1995
force-pushed
the
jack/label-list-distributed-build
branch
from
June 26, 2026 21:52
33be32e to
8570d98
Compare
Xuanwo
approved these changes
Jun 29, 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.
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.