vector-search: support scalar pre-filter before Top-K - #760
Merged
JingsongLi merged 14 commits intoSep 1, 2026
Conversation
jerry-024
reviewed
Aug 28, 2026
jerry-024
reviewed
Aug 28, 2026
jerry-024
reviewed
Aug 31, 2026
jerry-024
reviewed
Aug 31, 2026
jerry-024
reviewed
Aug 31, 2026
jerry-024
reviewed
Aug 31, 2026
JingsongLi
reviewed
Aug 31, 2026
JingsongLi
reviewed
Aug 31, 2026
JingsongLi
reviewed
Aug 31, 2026
JingsongLi
reviewed
Aug 31, 2026
JingsongLi
reviewed
Aug 31, 2026
JingsongLi
reviewed
Aug 31, 2026
JingsongLi
reviewed
Sep 1, 2026
…ector-prefilter # Conflicts: # crates/paimon/src/io/file_io.rs
JingsongLi
reviewed
Sep 1, 2026
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.
Summary
Support scalar pre-filtering before Top-K for data-evolution/global-index vector search, including DataFusion literal and lateral
vector_searchqueries.The scalar predicate is evaluated against the same pinned snapshot as vector search, producing global row IDs that are localized per vector-index shard and passed to the vector backend as an allow-list. A normal Paimon read is used so scalar global indexes such as BTree can prune the filter read while residual evaluation, partial index coverage, and deletion visibility remain exact.
Changes
VectorSearchBuilder::with_filterandBatchVectorSearchBuilder::with_filteron the data-evolution path.vector_searchwhile retaining anInexactresidual correctness check.EXPLAINoutput.Testing
cargo fmt --all --checkgit diff --checkcargo test -p paimon --lib table::vector_search_builder::testscargo test -p paimon-datafusion --lib filter_pushdown::tests::test_vector_prefilter_rejects_nan_literalscargo test -p paimon-datafusion --test read_tables vector_search_tests::test_vindex_build_then_vector_search_query -- --nocapturecargo test -p paimon-datafusion --test read_tables vector_search_tests::test_vector_search_lateral_join_uses_query_vectors -- --nocapturecargo clippy -p paimon --lib --tests -- -D warningscargo clippy -p paimon-datafusion --lib --tests -- -D warningsCovered cases include filter-before-Top-K ordering, empty matches, batch reuse, non-zero shard offsets, raw fallback for unindexed rows, time-travel snapshot pinning, literal SQL, lateral SQL, mixed/cross-side conjuncts, and NaN pushdown safety.
Notes
VectorSearch::include_row_idspublic API remains unchanged; this PR addsPreparedVectorSearchFilterand shared-filter builder support.hybrid_searchfeature.