Repository navigation
refactor!: add lance-datafusion-exec so lance-index skips datafusion - #10251
Conversation
There was a problem hiding this comment.
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.
|
@westonpace @BubbleCal Does this align with how you think the crate deps should work? I think a followup could move the RTREE index into lance-geo. |
|
I love this change! |
06d91ad to
9cce633
Compare
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The crate split removes the umbrella dependency from index compilation while retaining session-backed query execution. The rebase preserves the geo predicate fixes, per-row and NULL handling in contains_tokens, and zero-batch-size validation. Targeted execution, geo-registration, and scalar-filter tests passed, with no merge-blocking issue found.
9cce633 to
783c3ee
Compare
Move the parts of lance-datafusion that lance-index uses (exec nodes, LanceExecutionOptions, chunker, stream utils, UDFs, scalar coercion, column_names_in_expr, datagen) into a new lance-datafusion-exec crate built only on DataFusion sub-crates. lance-datafusion re-exports them under the same paths. lance-index and lance-index-core now depend on DataFusion sub-crates instead of the datafusion umbrella crate. lance-geo no longer depends on DataFusion; lance-datafusion registers the geodatafusion UDFs itself, so workspace feature unification does not pull the umbrella crate back in. BREAKING CHANGE: lance_index::scalar::expression::PlannerIndexExt is replaced by the free function create_filter_plan, which takes an already-optimized expression. Call Planner::optimize_expr first. Fixes #10244 Co-Authored-By: Claude Opus 5.5 <[email protected]>
783c3ee to
983f3e8
Compare
BREAKING CHANGE:
lance_index::scalar::expression::PlannerIndexExtis removed. Use the free functioncreate_filter_plan(expr, index_info, use_scalar_index), passing an expression already optimized withPlanner::optimize_expr.Summary
lance-index only used DataFusion sub-crate APIs, but it depended on the
datafusionumbrella crate directly and through lance-datafusion, lance-index-core and lance-geo. So it could not start compiling until the umbrella crate finished. This PR moves what lance-index needs into a newlance-datafusion-execcrate built only on the sub-crates, so lance-index compiles in parallel with the umbrella crate.lance-datafusion-execholds the moved code:OneShotExec,StrictBatchSizeExec,HardCapBatchSizeExec,LanceExecutionOptions, the execution metrics helpers,chunker,utils,datagen, thecontains_tokensand JSON UDFs,safe_coerce_scalarandcolumn_names_in_expr. Itsexecute_planruns under aTaskContextbuilt from the options (memory pool, spill dir, batch size) with no registered functions, which is all lance-index's sort and merge plans need.execute_planstill uses the cachedSessionContext, so query execution inlanceis unchanged. Both shareexecute_plan_with_context.PlannerIndexExtneededPlanner(SQL parsing, optimizer), so it is replaced bycreate_filter_plan, andlancecallsPlanner::optimize_exprfirst.geodatafusionUDFs itself, and thest_*relate-predicate wrappers from fix: evaluate constant-first spatial predicates correctly #10080 move fromlance-geo/src/udf.rstolance-datafusion/src/udf/geo.rsunchanged.lance_geo::register_functionsis gone;lance_datafusion::udf::register_functionsstill registers everything. Splitting lance-geo's features was not enough, because workspace feature unification turnedgeoback on for lance-index's copy.Evidence
Clean
cargo build --workspace --timings, dev profile, 16 cores, rustc wrapper cache disabled, one run each. Times in seconds from build start.datafusionumbrella finisheslancestartslancenow starts 2.7s after the umbrella crate finishes instead of 23.1s, so the umbrella crate is the only thing left on its critical path. Part of the 27.5s total difference is run-to-run noise (the shared DataFusion crates finished about 2.5s earlier in the PR run).Merge Risk
Door: Two-way. No format or persisted-state change; the code moves are mechanical and the old lance-datafusion paths still resolve.
Blast Radius:
public-api(PlannerIndexExtremoval in lance-index), index training plans in lance-index now run under a function-lessTaskContext, and geo UDF registration moved into lance-datafusion.Fixes #10244
🤖 Generated with Claude Code