-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Copy link
Labels
bugSomething isn't workingSomething isn't workingregressionSomething that used to work no longer doesSomething that used to work no longer does
Description
Describe the bug
CASE
sometimes eagerly evaluates the "then" or "else" branches.
To Reproduce
SELECT v, CASE WHEN v < 0 THEN 1/0 ELSE 1 END
FROM (VALUES (1), (2)) t(v)
Expected behavior
In DataFusion 44 this query run successfully
> SELECT v, CASE WHEN v < 0 THEN 1/0 ELSE 1 END
FROM (VALUES (1), (2)) t(v);
+---+---------------------------------------------------------------------+
| v | CASE WHEN t.v < Int64(0) THEN Int64(1) / Int64(0) ELSE Int64(1) END |
+---+---------------------------------------------------------------------+
| 1 | 1 |
| 2 | 1 |
+---+---------------------------------------------------------------------+
2 row(s) fetched.
Additional context
45.0.0
is the first version affected.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingregressionSomething that used to work no longer doesSomething that used to work no longer does