Skip to content

fix: lower negated row takes as exclusions - #9095

Open
lance-gatefixer[bot] wants to merge 2 commits into
mainfrom
gatekeeper/fix-9080-1
Open

fix: lower negated row takes as exclusions#9095
lance-gatefixer[bot] wants to merge 2 commits into
mainfrom
gatekeeper/fix-9080-1

Conversation

@lance-gatefixer

@lance-gatefixer lance-gatefixer Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • lower negated row-system-column IN predicates into block-list take selections
  • translate row addresses and row offsets into the row-id domain before applying inclusion or exclusion masks
  • cover complement results end to end for _rowid, _rowaddr, and _rowoffset

Root cause

TakeOperation::try_from_expr matched Expr::InList without preserving its negated flag, so NOT IN was serialized as an allow list and returned exactly the listed rows. The take selection now carries its polarity and serializes negated lists as block masks, including the _rowoffset path that cannot use normal filter refinement.

Validation

  • cargo fmt --all -- --check
  • cargo test -p lance test_filter_to_take --lib
  • cargo clippy --all --tests --benches -- -D warnings

Fixes #9080

@github-actions github-actions Bot added the bug Something isn't working label Sep 9, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-changes Latest Gatekeeper recommendation requests changes. label Sep 9, 2026
@lance-gatefixer lance-gatefixer Bot changed the title fix: reject negated row take predicates fix: lower negated row takes as exclusions Sep 9, 2026
@lance-gatekeeper lance-gatekeeper Bot removed the K-changes Latest Gatekeeper recommendation requests changes. label Sep 9, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gate recommendation: approve.

Negated _rowid, _rowaddr, and _rowoffset lists now preserve their polarity and lower through exclusion masks in the correct row-ID domain. This closes the earlier offset gap while keeping deletions, stable row IDs, and caller masks on the existing filtered-read path.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: _rowid NOT IN (...) returns exactly the listed rows instead of their complement

0 participants