Skip to content

feat(fts): allow external indexed input for hybrid queries - #9847

Merged
BubbleCal merged 2 commits into
mainfrom
yang/partial-index-hybrid-input
Oct 11, 2026
Merged

BubbleCal merged 2 commits into
mainfrom
yang/partial-index-hybrid-input

Conversation

@BubbleCal

@BubbleCal BubbleCal commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Distributed planners cannot replace the indexed work inside HybridCompoundQueryExec, so an appended unindexed tail keeps the entire indexed search on the query node.

Add with_indexed_input to accept a bounded, single-partition result stream and its committed-corpus BM25 scorer. The hybrid node continues to tokenize and score residual rows, then merges both arms with the existing score/row-ID ordering and limit. With an external input, it opens only the representative segment needed for the residual tokenizer. Physical child replacement preserves the input and scorer; schema, partition count, result cardinality and null checks enforce the input contract.

The compatibility-test harness also includes the merged fix from #9850, selecting lance-namespace>=0.13.0,<0.14 for published pylance>=14.0.0b10 wheels.

Validation on AWS with the repository's Rust 1.98.1 toolchain:

  • 343 FTS tests, two scanner compound tests and the new API doctest pass. The seven new API tests cover native result parity, child replacement and invalid input contracts.
  • cargo fmt --all -- --check passes.
  • Standard full-workspace Clippy reproduces 16 errors in unchanged lance-io on both this change and its pinned baseline 0fd26effc79c62c244a5baf92cdda06e301baf21. The same full-workspace check passes with command-line allowances for those two existing lints: -A clippy::single_range_in_vec_init -A clippy::implicit_clone. No source or repository lint settings were suppressed.
  • The Sophon integration passes 45 focused regressions and 1,628 complete related tests, with one existing ignored test, plus scoped Clippy on Rust 1.97.1 in release mode.

CI on df070dd26a1079426fdfecabf5b4a28b99dd2393: compatibility tests pass (421 passed, 10 skipped), as do Python lint and Rust Clippy/format checks. The compatibility fix changes only two Python test-harness files; Rust source and Cargo files are unchanged from the validated API commit.

The API change is based on Sophon's existing Lance pin and adds no storage or wire-format changes.

@github-actions github-actions Bot added the enhancement New feature or request label Oct 9, 2026
…9850)

## Summary

#9822 bumped pylance's `lance-namespace` requirement to
`>=0.13.0,<0.14`, first released in 14.0.0b10. The compat venv manager
still installed `lance-namespace>=0.11.1,<0.12` alongside it, so pip
failed with `ResolutionImpossible` and every `[14.0.0b10]` compat test
failed
([run](https://github.com/lance-format/lance/actions/runs/37979490950/job/113988344868)).
This maps pylance >=14.0.0b10 to the 0.13 range.

## Evidence

`test_lance_namespace_dependency` now covers 14.0.0b9 (0.11 range) and
14.0.0b10 (0.13 range).

## Merge Risk

**Door:** two-way. Only test harness code changes.
**Blast Radius:** none. Only the compat tests are affected.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit e85fab2)
@github-actions github-actions Bot added the A-python Python bindings label Oct 10, 2026
@BubbleCal
BubbleCal marked this pull request as ready for review October 11, 2026 07:03

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Gate recommendation: approve.

The external-input boundary supports distributed indexed search while preserving hybrid scoring and top-k semantics. Local parity, child-replacement, invalid-input, and compound-query checks found no merge-blocking issue.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 11, 2026
@BubbleCal
BubbleCal merged commit 4ac2f7c into main Oct 11, 2026
41 checks passed
@BubbleCal
BubbleCal deleted the yang/partial-index-hybrid-input branch October 11, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-python Python bindings enhancement New feature or request K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants