Skip to content

feat(index): support distributed LABEL_LIST index - #5262

Merged
yanghua merged 7 commits into
lance-format:mainfrom
ddupg:feat/distributed-label-list-segment-index
Jul 31, 2026
Merged

feat(index): support distributed LABEL_LIST index#5262
yanghua merged 7 commits into
lance-format:mainfrom
ddupg:feat/distributed-label-list-segment-index

Conversation

@ddupg

@ddupg ddupg commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • route LABEL_LIST builds through Lance segment APIs (create_index_uncommitted and commit_existing_index_segments)
  • validate list and large-list columns on the driver before Ray workers start
  • add multi-fragment LargeList coverage that checks physical segment count, query parity, and ScalarIndexQuery
  • document LABEL_LIST as a distributed scalar index

Why

PyLance v10.0.0-beta.7 exposes the existing LABEL_LIST segment lifecycle through create_index_uncommitted, including lance-format/lance#7884. Lance-Ray otherwise rejects LABEL_LIST as a distributed index and leaves it on the legacy fragment-metadata path.

Dependency

  • require pylance>=10.0.0b7
  • lock the official PyLance 10.0.0-beta.7 wheel published through the Lance Fury index

Validation

  • .venv/bin/pytest -q tests/test_vector_index_options.py tests/test_distributed_indexing.py::TestDistributedLabelListIndexing — 16 passed
  • .venv/bin/python -c "import lance; print(lance.__version__); print(lance.LanceDataset._is_segment_native_scalar_index_type(\"LABEL_LIST\"))"10.0.0-beta.7, True
  • .venv/bin/ruff check --no-cache lance_ray tests
  • .venv/bin/ruff format --no-cache --check lance_ray tests
  • uv lock --check
  • git diff --check

@github-actions github-actions Bot added the enhancement New feature or request label Jul 29, 2026
@ddupg
ddupg force-pushed the feat/distributed-label-list-segment-index branch from 9c2d6ba to 62799fb Compare July 30, 2026 07:36
@ddupg
ddupg marked this pull request as ready for review July 30, 2026 07:41

@yanghua yanghua left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left two comments.

assert indices["nested_text_idx"].field_names == ["meta.text"]
assert indices["literal_dot_text_idx"].field_names == ["meta.`a.b`"]
assert indices["hyphen_user_id_idx"].field_names == ["`meta-data`.`user-id`"]
assert indices["hyphen_user_id_idx"].field_names == ["meta-data.user-id"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must we remove the ` character?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, for this assertion. This change comes from upstream: lance-format/lance#7503. describe_indices() now uses minimal field-path quoting, so hyphens no longer add backticks. With the updated Lance version, the returned field name is meta-data.user-id, so the test expectation needs to match it.

Comment thread lance_ray/index.py
Comment on lines +599 to +606
case "LABEL_LIST":
if not (
pa.types.is_list(field.type) or pa.types.is_large_list(field.type)
):
raise TypeError(
f"Column {column} must be list or large list type for "
f"LABEL_LIST index, got {field.type}"
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newly added LABEL_LIST type validation is only executed when index_type is a string. If the caller passes in an IndexConfig object in accordance with the public contract, this early validation will be skipped. As a result, invalid column types cannot be detected in advance on the Driver side, and failures may be deferred until the Ray worker execution phase. right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that’s right. The existing driver-side checks for the other scalar indexes also only run when index_type is a string; IndexConfig skips them today. This PR follows the existing pattern and keeps the change focused on adding LABEL_LIST. I’m considering aligning validation for string and IndexConfig inputs in lance-format/lance-ray#5250, rather than mixing that broader change into this PR.

@ddupg
ddupg requested a review from yanghua July 31, 2026 08:38
@yanghua
yanghua merged commit 81e86f7 into lance-format:main Jul 31, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants