Fix physical distinctness expression nullability - #24244
Open
blinding-pixels wants to merge 1 commit into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #24244 +/- ##
==========================================
- Coverage 80.99% 80.99% -0.01%
==========================================
Files 1106 1106
Lines 383549 383567 +18
Branches 383549 383567 +18
==========================================
+ Hits 310644 310654 +10
Misses 54570 54570
- Partials 18335 18343 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Which issue does this PR close?
Rationale for this change
When aggregate CSE extracts a repeated truth check, the logical and physical plans assign different nullability metadata to it, causing planning to fail. Since these truth checks always return either true or false, the physical plan should mark them as non-nullable.
What changes are included in this PR?
This PR updates physical
BinaryExprnullability soIS DISTINCT FROMandIS NOT DISTINCT FROMare always reported as non-nullable.It also adds a focused unit-test matrix and a SQL logic regression covering the aggregate CSE path reported in the issue.
Are these changes tested?
Yes. The tests cover both distinctness operators, ordinary equality as a control, and the reported aggregate query.
Formatting, Clippy, focused tests, and the extended workspace test suite all pass.
Are there any user-facing changes?
Yes. Affected queries using repeated truth checks on nullable Boolean values now plan and execute instead of failing with a logical/physical schema mismatch.
There are no public API changes.