Repository navigation
Conversation
This was referenced Aug 17, 2026
wjones127
force-pushed
the
will/logical-planner-4-leaf
branch
from
August 17, 2026 16:16
7d213c2 to
e1ddc5f
Compare
`Scanner::create_plan` builds DataFusion physical plans directly, by hand. This adds an alternative path that assembles the query as a `LogicalPlan`, runs a curated rule set over it, and lowers it with an `ExtensionPlanner`. It is off unless `LANCE_LOGICAL_SCAN_PLANNER=1`. This first layer covers plain scans: filter, projection, sort, limit, aggregate. Searches and `_rowoffset` are rejected rather than silently mis-planned; later PRs add them. The pieces are: * `source` — the scan leaf as a `TableProvider`, including the branch to the frozen legacy (v1) scan builder. * `builder` — `Scanner` state to an unoptimized `LogicalPlan`. Synchronous, no I/O. * `context` — the bridge. An `OptimizerRule` is synchronous and so cannot load index metadata; this fetches everything up front, and each rule holds an `Arc` to it. * `scan_index` — the one rule this layer has, recording on each scan leaf how it finds its rows, so the index decision is visible in the plan rather than private to `TableProvider::scan`. * `planner` — stage 4 dispatch, empty until a later layer adds a node. `ensure_supported` destructures `Scanner` exhaustively, so a new field fails to compile until someone decides what this path does with it. Every test in `tests/` also plans the same query through the imperative path and asserts the two return the same rows in the same order. That comparison goes away with the imperative path; the assertions about the answer stay.
wjones127
force-pushed
the
will/logical-planner-4-leaf
branch
from
August 17, 2026 19:08
e1ddc5f to
13e8852
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This branch has not been deployed
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.
Scanner::create_planbuilds DataFusion physical plans directly, by hand. This adds an alternative path that assembles the query as aLogicalPlan, runs a curated rule set over it, and lowers it with anExtensionPlanner. It is off unlessLANCE_LOGICAL_SCAN_PLANNER=1.This first layer covers plain scans: filter, projection, sort, limit, aggregate. Searches and
_rowoffsetare rejected rather than silently mis-planned; later PRs add them.The pieces are:
source— the scan leaf as aTableProvider, including the branch to the frozen legacy (v1) scan builder.builder—Scannerstate to an unoptimizedLogicalPlan. Synchronous, no I/O.context— the bridge. AnOptimizerRuleis synchronous and so cannot load index metadata; this fetches everything up front, and each rule holds anArcto it.scan_index— the one rule this layer has, recording on each scan leaf how it finds its rows, so the index decision is visible in the plan rather than private toTableProvider::scan.planner— stage 4 dispatch, empty until a later layer adds a node.ensure_supporteddestructuresScannerexhaustively, so a new field fails to compile until someone decides what this path does with it.Every test in
tests/also plans the same query through the imperative path and asserts the two return the same rows in the same order. That comparison goes away with the imperative path; the assertions about the answer stay.Stack created with GitHub Stacks CLI • Give Feedback 💬