Repository navigation
query: add vector query post-filter - #82
Merged
Merged
Conversation
Expose lancedb_vector_query_postfilter(), mapping to the Rust SDK's postfilter() so a filter can run after the vector search. The default stays prefilter=true and the option applies to both execution and explain-plan. Add coverage for prefilter vs postfilter row counts, explain-plan routing, and null-handle validation.
Own the postfilter flag before the explain path borrows the query into its async block, so the runtime rework can snapshot it with the other query parameters. Use single-quoted SQL literals in the new test, which both the 0.33 and 0.42 SDKs accept.
Main now propagates SQL predicates into explain plans (#84). Add a public where_filter plus postfilter explain section to the post-filter test, checking the predicate appears in both modes and the plans differ.
Xuanwo dropped Intel macOS support. Remove only the x86_64-apple-darwin matrix entry; the standalone packaging cleanup owns script and docs references.
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.
Add an additive C API to run a vector query filter after the vector search, matching the Rust SDK's
postfilter()behavior requested in #51.lancedb_vector_query_postfilter()on the opaqueLanceDBVectorQuery. It setsprefilter = false; without calling it, the SDK defaultprefilter = trueis preserved.lancedb_vector_query_executeandlancedb_vector_query_explain_plan, so the plan reflects the option.limitrows and thatrefine_factorcan recover some results.Tests (Release, Arrow 26.0.1, Catch2 v2.13.10):
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ONcmake --build build --target lancedb_vector_query_tests -j 12cd build && ./lancedb_vector_query_tests-> 45019 assertions, 12 test cases passedctest -R vector_query --output-on-failure-> 1/1 passedThe new test verifies the observable result difference (pre-filter returns the far matching row; post-filter returns none from the nearest five) and that the explain plan differs between the two modes. Existing
[vector_query]coverage passes unchanged.Closes #51.