Repository navigation
Add explain-plan FFI for query and vector query - #70
Conversation
Expose LanceDB's query plan through the C ABI so callers can inspect the execution plan without running the query. Adds two functions: - lancedb_query_explain_plan(query, verbose, out_plan, out_error) - lancedb_vector_query_explain_plan(query, verbose, out_plan, out_error) Both return LanceDBError and write the plan text to an out-param. Used by RGW S3 Vectors' explainPlan / explainOnly QueryVectors feature. Signed-off-by: gal salomon <[email protected]> Co-Authored-By: Claude Opus 4.8 <[email protected]>
| if let Some(ref df_filter) = query_ref.df_filter { | ||
| rust_query.mut_query().filter = | ||
| Some(QueryFilter::Datafusion(df_filter.clone())); | ||
| } else if let Some(ref filter) = query_ref.filter { |
There was a problem hiding this comment.
do we allow for both sql filter and datafusion filter to exist in the query?
if we don't, we should probably treat that as an error here as well (instead of one taking precendence ocer the other)
There was a problem hiding this comment.
why did you remove the sql filter?
our API here support both. just not together - it should be considered as an error
| if let Some(ref select) = query_ref.select { | ||
| rust_query = rust_query.select(select.clone()); | ||
| } | ||
| if let Some(ref df_filter) = query_ref.df_filter { |
|
… case we will use the SQL ..., it should be back Signed-off-by: Gal Salomon <[email protected]>
fd5ac2d to
f749421
Compare
|
@yuvalif |
but we also need to add unit tests here: https://github.com/lancedb/lancedb-c/tree/main/tests |
Add Catch2 cases exercising lancedb_query_explain_plan and lancedb_vector_query_explain_plan: basic (verbose/non-verbose) plans, the DataFusion-filter branch, tuning options (distance/nprobes/ refine_factor/ef), the non-consume contract (query still executable after explain), and null-argument guards. Restores coverage lost by the explain-plan functions added in this PR. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Expose LanceDB's query plan through the C ABI so callers can inspect the execution plan without running the query. Adds two functions:
Both return LanceDBError and write the plan text to an out-param. Used by RGW S3 Vectors' explainPlan / explainOnly QueryVectors feature.