alamb commented on PR #20097:
URL: https://github.com/apache/datafusion/pull/20097#issuecomment-3837920282

   BTW I think we could add some more test coverage -- here are some cases for 
case.slt that are worth considering (written by codex)
   
   ```sql
     # single WHEN, no ELSE (absent)
     query
     SELECT CASE WHEN a > 0 THEN b END
     FROM (VALUES (1, 10), (0, 20)) AS t(a, b);
     ----
     10
     NULL
   
     # single WHEN, explicit ELSE NULL
     query
     SELECT CASE WHEN a > 0 THEN b ELSE NULL END
     FROM (VALUES (1, 10), (0, 20)) AS t(a, b);
     ----
     10
     NULL
   
     # fallible THEN expression should only be evaluated on true rows
     query
     SELECT CASE WHEN a > 0 THEN 10 / a END
     FROM (VALUES (1), (0)) AS t(a);
     ----
     10
     NULL
   
     # all-false path returns typed NULLs
     query
     SELECT CASE WHEN a < 0 THEN b END
     FROM (VALUES (1, 10), (2, 20)) AS t(a, b);
     ----
     NULL
     NULL
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to