Repository navigation
query: honor SQL filters in explain plans - #84
Merged
Merged
Conversation
Apply the stored SQL filter when no DataFusion expression is set so the basic and vector EXPLAIN paths describe the same filtering as execution. Add public C/C++ checks for SQL predicate propagation and missing-column errors.
Xuanwo
added a commit
that referenced
this pull request
Nov 21, 2026
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
added a commit
that referenced
this pull request
Nov 21, 2026
* bindings: add vector query post-filter 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. * query: copy postfilter before explain future 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. * tests: cover SQL filter with post-filter explain 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. * ci: drop Intel macOS from the package matrix 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.
Both
lancedb_query_explain_planandlancedb_vector_query_explain_planonly applied the stored DataFusion expression, so a query configured withlancedb_query_where_filterorlancedb_vector_query_where_filterexplained a plan without its SQL predicate while execution applied it. Restore the SQL fallback after the DataFusion check, matching execution and the precedence already documented in the header.Public C/C++ tests cover both query kinds: a valid SQL filter must appear in the plan, and a filter on a missing column must make EXPLAIN fail instead of returning an unfiltered plan. String literals use single quotes so the tests work with both the current SDK and the 0.42 upgrade.
Validation:
cargo fmt --check,git diff --check, andg++ -fsyntax-onlyfor both modified test files. Hosted CI will run the C++ suites; no local Rust build was run because another task holds the host build lease.