Add segmented index workflow for INVERTED and FTS#28
Open
everySympathy wants to merge 1 commit into
Open
Conversation
8f03cd7 to
a685116
Compare
eb57842 to
e5f918c
Compare
e5f918c to
aafb17e
Compare
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
This PR updates daft-lance to use Lance's public scalar segment-index workflow for distributed scalar index creation.
It bumps the Lance dependency to the Lance 8.0.0 release line and removes the prerelease Lance Fury index configuration that was only needed for beta wheels.
The existing distributed scalar index path for
BTREE,INVERTED, andFTSis migrated away from the legacy metadata merge flow. Workers now build uncommitted fragment-local index segments withcreate_index_uncommitted(..., fragment_ids=...), and the coordinator commits those segments withcommit_existing_index_segments(...).For
INVERTED/FTS, worker-built segments are merged withmerge_existing_index_segments(...)before the final commit.Because Lance's public
commit_existing_index_segments(...)API does not currently expose atomic replacement of an existing committed index, the segmented workflow now rejects attempts to reuse an existing index name before workers build new segments. Worker-side segment creation always usesreplace=False, so an existing committed index is not modified during distributed segment construction.Why
The old partitioned metadata merge path is not compatible with Lance 8 for
BTREE, and can produce indices whose deprecatedlist_indices()type appears asUnknown.Using the public segment-index workflow gives committed indices with usable
describe_indices()details and matches the newer Lance scalar indexing API.Changes
pylanceto>=8.0.0create_index_uncommitted(...)for scalar segment creationcommit_existing_index_segments(...)INVERTED/FTSsegments before commitBTREEandINVERTEDuse the segment-index workflow by defaultdescribe_indices()and full-text queriesValidation
uv run pytest -q tests/io/lancedb/test_lancedb_scalar_index.pyuv run ruff check daft_lance/lance_scalar_index.py daft_lance/_lance.py tests/io/lancedb/test_lancedb_scalar_index.pygit diff --checkuv lock --check