-
Notifications
You must be signed in to change notification settings - Fork 28.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-49396][SQL] Modify nullability check for CaseWhen expression
### What changes were proposed in this pull request? Previously, the nullability check of CaseWhen checks that (1) either of the branches including elseValue is nullable or (2) elseValue is None. The pr changes this nullability check to add concerns for TrueLiteral branches. If there are trueLiteral branches, the nullability check will only consider branches before first TrueLiteral branch and the value of TrueLiteral branch as later branches will never be invoked. ### Why are the changes needed? This nullability check is more accurate and align with SimplifyConditional rule. ### Does this PR introduce _any_ user-facing change? no ### How was this patch tested? added unit test ### Was this patch authored or co-authored using generative AI tooling? no Closes #47981 from averyqi-db/SPARK-49396-fix-nullability-check. Authored-by: Avery Qi <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
- Loading branch information
1 parent
f3d2ebd
commit 2c1e69c
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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