Repository navigation
Conversation
Three independent changes to the read path's exec nodes, all of which the logical planner needs before it can build these nodes from rules: * `SimplifyProjection` folds a column-only projection into the projection below it and re-examines the result, so stacked projections collapse. A hand-built physical plan never emitted them; a lowered one does. * `RowOffsetMap` splits `AddRowOffsetExec`'s fragment prefetch out of its constructor, so a planner that must build nodes synchronously can load it up front. * `AddRowOffsetExec::partition_statistics` now reports a column entry for the column it appends, instead of passing its input's statistics through unchanged. Also fixes a capacity underflow in `row_ids_for_mask`: it subtracted the block list's length from the row count, which underflows when a plan materializes an index over a fragment subset the block list ranges beyond.
wjones127
force-pushed
the
will/logical-planner-3-exec
branch
from
August 17, 2026 19:08
c3a9ebc to
acf0ad7
Compare
This was referenced Oct 15, 2026
LuQQiu
pushed a commit
that referenced
this pull request
Oct 15, 2026
ANN scans projecting `_rowoffset` with default distance ordering could panic during physical optimization. `AddRowOffsetExec` appended an output field but returned only the input columns’ statistics, causing DataFusion’s projection statistics to index past the end. Append unknown statistics for `_rowoffset` and clear the input-only byte count while preserving the row count and existing column statistics. This is a focused fix for the statistics issue also covered by #8566. Regression coverage includes known and unknown statistics, global and per-partition statistics, and three-fragment ANN queries with deletions, stable and address-style row IDs, and both offset-only and ID-plus-offset projections. ANN results assert exact neighbors, offsets, distances, and recall of 1.0. Validation on macOS arm64 with Rust 1.98.1 and the repository `ci` profile: - All 8 new regression cases fail on the unchanged base; ANN cases reproduce the DataFusion projection panic. - `cargo test --profile ci --locked -p lance --lib row_offset`: 11 passed. - `cargo test --profile ci --locked -p lance --lib io::exec::rowids::test`: 10 passed. - `cargo clippy --profile ci --locked --all --tests --benches -- -D warnings` passed. - `cargo fmt --all -- --check` and `git diff --check` passed.
Xuanwo
added a commit
that referenced
this pull request
Nov 14, 2026
Closes #10854. The value is only the initial capacity of the returned `Vec`, so it now uses `saturating_sub`. The returned row ids are unchanged: the requested fragments' row ids minus the blocked ones. Draft #8566 has the same one-line change without a test, so whichever lands second can drop that hunk. ## How was this patch tested `test_not_equal_filter_on_fragment_subset_legacy_stable_row_ids` writes 100 rows in 10 fragments with legacy storage and stable row ids, builds a BTree index, and scans fragment 0 with `c != 0`. It checks that the plan uses `MaterializeIndex` and that the scan returns the fragment's 5 matching rows. Without this change it panics. ## Integration validation Merged current `main` at `cdefd7edfc71f91368898d1fec6da789c5f80f5c` into the PR branch; the diff against `main` remains the two files above (+45/-2). On the merged tree: - `cargo test -p lance --locked --profile ci test_not_equal_filter_on_fragment_subset_legacy_stable_row_ids` — 1 passed. - `cargo test -p lance --lib --locked --profile ci io::exec::scalar_index::tests` — 13 passed. - `cargo test -p lance --lib --locked --profile ci test_btree_nullable_filters_match_unindexed_scan` — 1 passed. - `cargo clippy --profile ci --all --tests --benches --locked -- -D warnings` — clean. - `cargo fmt --all` — clean. The `Closes #10854` scope stays the legacy-storage, stable-row-id, fragment-subset negated-index-filter panic described in the issue; the saturating subtraction only protects the capacity hint, and row ids are still filtered by `!block_list.contains`. --------- Co-authored-by: Xuanwo <[email protected]>
Contributor
|
Thank you for your contribution. This PR has been inactive for a while, so we're closing it to free up bandwidth. Feel free to reopen it if you still find it useful. |
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.
Three independent changes to the read path's exec nodes, all of which the logical planner needs before it can build these nodes from rules:
SimplifyProjectionfolds a column-only projection into the projection below it and re-examines the result, so stacked projections collapse. A hand-built physical plan never emitted them; a lowered one does.RowOffsetMapsplitsAddRowOffsetExec's fragment prefetch out of its constructor, so a planner that must build nodes synchronously can load it up front.AddRowOffsetExec::partition_statisticsnow reports a column entry for the column it appends, instead of passing its input's statistics through unchanged.Also fixes a capacity underflow in
row_ids_for_mask: it subtracted the block list's length from the row count, which underflows when a plan materializes an index over a fragment subset the block list ranges beyond.Stack created with GitHub Stacks CLI • Give Feedback 💬