fix: support boolean predicates in scalar segment scans - #93
Merged
yanghua merged 3 commits intoSep 30, 2026
Merged
Conversation
There was a problem hiding this comment.
✅ Gate recommendation: approve.
Segment-scoped AND/OR/IN and ordinary NOT preserve the explicit fragment domain and recheck the complete predicate before LIMIT/OFFSET. Boolean truth tests safely retain the scoped fallback for the pinned planner, preserving matching NULL rows.
The new Substrait LabelList regressions confirm label intersections and unions, NULL/empty semantics, partial coverage, pagination, and deletion handling with both row-ID modes. The documented cross-engine boundaries match the pinned Lance semantics. This follow-up adds tests and documentation without changing production execution or the ABI.
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.
A scoped scalar scan currently selects only a single index leaf beneath AND. A short
INlist rewritten to OR therefore falls back to scanning the entire requested fragment domain, even when every branch is supported by the selected segment.Evaluate a scoped
ScalarIndexExprusing Lance's boolean evaluator and a loader pinned to the selected physical segment. This supports AND, OR, IN, and NULL-aware NOT through the existing C/C++ API, with no ABI or dependency changes.IS [NOT] TRUE/FALSEuse the scoped fallback before planning: the pinned planner loses their NULL semantics under negation. This guard can be removed after adopting fix(index): keep negated scalar index filters correct on NULL rows lance#9568. Ordinary equality negation remains indexed.Validation: the new IN regression was observed failing on the original implementation with
scalar_segment_fallback_no_driver=1. After the fix, the string IN regression reads four candidate rows instead of all eight rows in its fragment domain. Tests cover BTree/Bitmap, integer/string keys, NULL and empty results, stable row IDs, deleted rows, subset/partial fragment coverage, residual pagination, other indexed columns, unsafe negation, and expression budgets.cargo fmt --checkcargo check --locked --all-targetscargo clippy --locked --all-targets -- -D warningscargo test --locked: 456 tests passedcargo test --locked --test compile_and_run_test -- --ignored: 3 tests passed on implementation commit 78626b1 (before the test/documentation follow-up)Nullable-boolean regressions cover both index types and stable-row-ID modes, positive and negated truth tests, nested AND/OR, fragment scope, pagination, and continued acceleration of
NOT (key = true). The review reproducer failed with missing NULL rows before the guard was added.Array-label integration coverage: