Skip to content

fix(datafusion): preserve boolean expression literal types - #9322

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

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

Conversation

@lance-gatefixer

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

Copy link
Copy Markdown
Contributor

Summary

  • resolve typed right-hand expressions in their own column context
  • retain column-type coercion for literal-only same-type expressions, including shifts and string concatenation
  • add planning and execution coverage for Boolean and constant-expression comparisons

Root cause

The filter resolver recursively coerced every literal inside any right-hand binary expression to the type of the outer left column. When the outer column was Boolean, literals belonging to nested numeric comparisons were incorrectly converted to Boolean before DataFusion planned the expression.

Validation

  • cargo fmt --all
  • cargo test -p lance-datafusion (188 tests and doctests passed)
  • cargo clippy --all --tests --benches -- -D warnings

Fixes #9319

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

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Sep 16, 2026
@lance-gatekeeper lance-gatekeeper Bot removed K-risk Latest Gatekeeper recommendation includes a non-blocking risk. K-approved Latest Gatekeeper recommendation permits acceptance. labels Sep 16, 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.

The prior non-blocking coercion risk is fixed in e6c385771: supported constant shifts and string concatenation now retain the column type, with execution regression tests covering both. The original Boolean-expression fix remains intact and no material residual risk remains.

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: comparing a boolean column with a boolean expression fails to plan when the expression contains a literal

0 participants