feat: expose staged index segment transactions

Draft
RA
6mo ago
+6473-3069

Summary

  • Add DatasetIndexExt::build_existing_index_segments_transaction to prepare an Operation::CreateIndex transaction for existing index segments without committing.
  • Refactor commit_existing_index_segments to reuse the staged transaction path.
  • Add coverage that verifies staging does not publish the index and the returned transaction can be committed via CommitBuilder.

Tests

  • cargo fmt --all
  • cargo test -p lance existing_index_segments -- --nocapture
  • cargo test -p lance test_vector_execute_uncommitted_segments_commit_without_staging -- --nocapture
  • External crate cargo check against the new public API

Fixes lance-format/lance#6666

Open in Web Open in Cursor 

Summary by cubic

Adds a staged transaction builder to publish existing index segments without auto-committing, enabling two-phase index creation; refactors the existing commit path to use it. Also pulls in recent search and tokenizer improvements from main.

  • New Features

    • DatasetIndexExt::build_existing_index_segments_transaction(index_name, column, segments) -> Transaction for staging, then commit via CommitBuilder (and commit_existing_index_segments now uses this path).
    • Search upgrades: batch KNN queries with a query_index column; fast_search for scalar indexes to scan only indexed fragments; ICU-based FTS tokenizer via base_tokenizer="icu".
  • Bug Fixes

    • Correctness: apply LIMIT after refine filters in filtered reads; fix stale reads in mem_wal via dedup-on-scan and deletion vectors; stable-row-id deletion masks honor fragment bitmaps; coerce expressions before simplification to avoid UDF panics.
    • Performance/maintenance: avoid extra stat calls on OpenDAL ranged reads; clean up IVF shuffler temp dirs.