findepi opened a new issue, #15384:
URL: https://github.com/apache/datafusion/issues/15384

   ### Describe the bug
   
   `CASE` sometimes eagerly evaluates the "then" or "else" branches.
   
   ### To Reproduce
   
   ```sql
   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to