Repository navigation
fix(scan): preserve candidates from inexact scalar index results - #9789
Merged
Merged
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
Preserving the full fallback range fixes the silent row loss in #9787 while retaining guaranteed-match limit pushdown. The scanner regressions and all 94 filtered-reader tests pass locally (reader suite run serially).
wjones127
approved these changes
Oct 9, 2026
ruslan-shaydullin
added a commit
to ruslan-shaydullin/lance
that referenced
this pull request
Oct 12, 2026
Merge upstream main after the external indexed input for hybrid queries (lance-format#9847) and the scalar index candidate fix (lance-format#9789). Only the fts.rs test import list conflicted; it now carries both sides, and the restricted Match patch itself is unchanged. Signed-off-by: Ruslan Shaydullin <[email protected]>
wjones127
pushed a commit
that referenced
this pull request
Oct 19, 2026
The planner correction for #9772 has landed on `main` through #9789: lower-bound index results retain candidates that still need predicate evaluation. This PR adds regression coverage for NGram needles whose trigrams are all removed by tokenization. Compare indexed and unindexed results for punctuation, Unicode, empty strings, and nulls across three fragments and both row-ID modes. Extend the lower-bound scan test with empty guaranteed sets and partial limit/offset results. The merged base includes #9850, which corrects the compatibility environment's namespace dependency for `pylance>=14.0.0b10`. Validation: - Six punctuation cases failed on the original implementation and pass with the planner correction. - `cargo test -p lance --profile ci test_ngram --lib`: 20 passed. - `cargo test -p lance --profile ci test_not_or_zone_map --lib`: 8 passed. - `cargo test -p lance --profile ci io::exec::filtered_read::tests --lib -- --test-threads=1`: 141 passed. - `cargo fmt --all`: passed. - `cargo clippy --all --tests --benches -- -D warnings`: passed. - `uv run pytest --run-compat python/tests/compat/test_venv_manager.py`: 14 passed. - `uv run make lint`: passed (Ruff, type checking, Rust formatting, and binding Clippy). - `make build` from `python/`: passed. - Beta dependency dry-run: `pylance==14.0.0b10` resolves with `lance-namespace>=0.13.0,<0.14`. The filtered-read suite runs serially to avoid interference between shared tracing counters. Fixes #9772 <!-- lance-gatekeeper-fix:v1 agent=9fb12c67db5d937ba8c02cbd14ef1f66 generation=1 --> Co-authored-by: Gatefixer <312823363+lance-gatefixer[bot]@users.noreply.github.com>
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.
Fixes #9787
Combining a negated exact scalar predicate with a zone map predicate can produce an
AtLeastresult: some rows are guaranteed matches, while others still need a filter recheck. The reader incorrectly used only the guaranteed rows for its fallback scan, dropping candidate matches when no limit applied or the guaranteed rows could not satisfy the limit.Preserve the full candidate range for fallback scans and retain the guaranteed ranges for successful limit pushdown. Add small multi-fragment regressions covering the reported filters, NULL values, stable row IDs, and limit/offset fallback.
Validation:
NOTpasses.cargo test -p lance --profile ci test_not_or_zone_map: 8 passed.cargo test -p lance --profile ci io::exec::filtered_read::tests: 94 passed.cargo fmt --all.cargo clippy --all --tests --benches -- -D warnings.