pepijnve commented on PR #17813:
URL: https://github.com/apache/datafusion/pull/17813#issuecomment-3514121797

   In 427fc30fed1bfdfd49f5098a3e1ba955e5452704 I've added an SLT that 
illustrates how better nullability reporting may allow optimisation of certain 
queries. It's a contrived query, but it's just a test
   
   The query
   
   ```
   SELECT CASE WHEN CASE WHEN a IS NOT NULL THEN a ELSE 1 END IS NOT NULL THEN 
a ELSE 1 END FROM (
       VALUES (10), (20), (30)
     ) t(a)
   ```
   
   get squashed down to
   
   ```
   ProjectionExec: expr=[column1@0 as CASE WHEN CASE WHEN t.a IS NOT NULL THEN 
t.a ELSE Int64(1) END IS NOT NULL THEN t.a ELSE Int64(1) END]
   ```
   
   while current `main` will evaluate this as
   
   ```
   ProjectionExec: expr=[CASE WHEN CASE WHEN column1@0 IS NOT NULL THEN 
column1@0 ELSE 1 END IS NOT NULL THEN column1@0 ELSE 1 END as CASE WHEN CASE 
WHEN t.a IS NOT NULL THEN t.a ELSE Int64(1) END IS NOT NULL THEN t.a ELSE 
Int64(1) END]
   ```


-- 
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