Conditional expressions should only evaluate "else" predicate if "if" predicate is false
- Dominant language
- Rust
- Stars
- 9.3k
- Forks
- 2.4k
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 344
Description
**Describe the bug**
For conditional expressions, we currently evaluate both the true and false expressions, which can lead to correctness issues.
For example, we cannot run this valid query.
```
❯ select case when x is null then 42 else x * x end from (select null as x);
ArrowError(ExternalError(Internal("Data type Null not supported for binary operation 'multiply' on primitive arrays")))
```
**To Reproduce**
**Expected behavior**
**Additional context**
Contributor guide
Research direction
Start by reproducing the provided SELECT CASE query and trace DataFusion's conditional-expression evaluation to find where both branches are evaluated. Done means the query returns 42 without the invalid multiplication error, with regression coverage for the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100