pepijnve commented on issue #17801:
URL: https://github.com/apache/datafusion/issues/17801#issuecomment-3342798615

   To confirm my hunch I hacked together a quick check that I added to the 
expression simplifier and that confirms
   
   ```
   if transformed.transformed {
       let is_nullable = self.info.nullable(&transformed.data)?;
       if is_nullable != was_nullable {
           return plan_err!(
               "Nullability changed from {} to {} when simplifying {} to {}",
               was_nullable,
               is_nullable,
               original,
               transformed.data
           );
       }
   }
   ```
   
   results in
   
   ```
   Error: Context("Optimizer rule 'simplify_expressions' failed", 
Plan("Nullability changed from false to true when simplifying 
coalesce(CAST(catalog_returns.cr_return_quantity AS Int64), Int64(0)) to CASE 
WHEN CAST(catalog_returns.cr_return_quantity AS Int64) IS NOT NULL THEN 
CAST(catalog_returns.cr_return_quantity AS Int64) ELSE Int64(0) END"))
   ```
   
   Is that supposed to be allowed? In other words, should the simplifier be 
handling this case or not?


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