Repository navigation
refactor: rework scalar index loading, training, and parsing into a plugin trait - #4584
Merged
westonpace merged 10 commits intoSep 2, 2025
Merged
Conversation
wjones127
approved these changes
Aug 28, 2025
wjones127
left a comment
Contributor
There was a problem hiding this comment.
Cool to see the index types behind a trait.
Approved pending CI.
westonpace
force-pushed
the
refactor/scalar-index-plugins
branch
2 times, most recently
from
August 28, 2025 22:47
9ec646b to
28c3e0c
Compare
westonpace
force-pushed
the
refactor/scalar-index-plugins
branch
from
August 29, 2025 12:15
1d8599d to
d34c875
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4584 +/- ##
==========================================
- Coverage 80.93% 80.82% -0.11%
==========================================
Files 314 315 +1
Lines 117064 117713 +649
Branches 117064 117713 +649
==========================================
+ Hits 94749 95146 +397
- Misses 18931 19154 +223
- Partials 3384 3413 +29
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
|
I like the PR, great simplification |
jackye1995
pushed a commit
to jackye1995/lance
that referenced
this pull request
Jan 21, 2026
…lugin trait (lance-format#4584) These operations were previously all done via match statements. This made it difficult to create new index types.
Xuanwo
added a commit
that referenced
this pull request
Nov 13, 2026
…ead (#10776) ## Why The scalar index benchmarks should run to completion. Four bench targets panicked in their first benchmark, because each one fed its trainer a stream with column names the trainer does not read. - `lance` `scalar_index`. The fixture trained the B-tree from `values` and `row_ids`, but `train_btree_index` reads `value` and `_rowaddr`. Training has looked up `value` by name since #4584, and #9481 moved the row column from `_rowid` to `_rowaddr`. - `lance-index` `btree` and `bitmap`. The shared generators in `benches/common.rs` wrote `_rowid`. The B-tree trainer has read `_rowaddr` since #9481, and the bitmap trainer has since #9814. - `lance-index` `ngram`. The bench named its text column `doc`, but `NGramIndexBuilder::train` has looked up `value` since #4584. ## What changed - In `scalar_index.rs`, `test_data` takes the value and row column names. The training stream passes `VALUE_COLUMN_NAME` and `ROW_ADDR`. The dataset keeps `values` and `row_ids`, so the baseline benchmarks scan the same data as before. - In `common.rs`, the five generators write `ROW_ADDR` instead of `_rowid`. - In `btree.rs`, the ordered-search benchmark had its own copy of `generate_int_unique_stream` with a `_rowaddr` column. It now calls the shared generator, and the imports that only the copy used are gone. - In `ngram.rs`, the text column is `VALUE_COLUMN_NAME`. The row column stays `ROW_ADDR`, which main already used after #9858 moved NGram to the row-address domain. ## Scope - Only bench files change. The benchmarks, their queries, and their assertions stay the same. - The `zonemap`, `bloomfilter`, `inverted`, `geo`, and `minhash_lsh` benches already write the columns their trainers read, so they do not change. - A missing row column still fails B-tree and bitmap training with the vague error `Expected option to have value`. A schema check with a clear message belongs in the trainers, in a separate change. ## Tradeoffs - The `scalar_index` dataset cannot use the training names, because Lance rejects a stored column named `_rowaddr`. - A second generator for the `scalar_index` training stream would repeat the row and batch counts that every assertion depends on. ## Blast radius The change touches bench code only. Library code, the file format, and tests do not change. ## Verification The branch is merged with `main` at `01036bf80`. Every command below ran in criterion test mode on that merged tree with `--profile ci --locked`, and each benchmark reports `Success`, so this covers the fixture generation and trainer calls rather than compilation alone. - `cargo test --profile ci --locked -p lance-index --bench btree`: 84 `Success`, including `btree_ordered_first_k` and `tuple_planning`. - `cargo test --profile ci --locked -p lance-index --bench bitmap`: 40 `Success`. - `cargo test --profile ci --locked -p lance-index --bench ngram`: 2 `Success` (`ngram_train`, `ngram_search`). - `cargo test --profile ci --locked -p lance --bench scalar_index`: 5 `Success`, including both baseline scans. - `cargo fmt --all -- --check` and `cargo clippy --profile ci --all --tests --benches --locked -- -D warnings` pass. On the original base, before the fix, `--bench btree` and `--bench bitmap` panicked with `Expected option to have value`, and `--bench ngram` panicked with `Unable to get field named "value"`. --------- Co-authored-by: Cursor <[email protected]> Co-authored-by: Xuanwo <[email protected]>
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.
These operations were previously all done via match statements. This made it difficult to create new index types.