jayzhan211 commented on PR #11897:
URL: https://github.com/apache/datafusion/pull/11897#issuecomment-2283111332

   > the only way for us to know whether return an empty set or a null is in 
execution
   
   What is the reason that we could not determine the result in the the 
optimizer? Is there any counter example that does not work if we rewrite 
expression and could only be determined while execution? 
   
   InList is one of the example that returns empty set and it is rewritten 
early in ExprSimplifier
   ```
   query I
   select x from t where x IN (1,2,3) AND x IN (4,5);
   ----
   
   query TT
   explain select x from t where x IN (1,2,3) AND x IN (4,5);
   ----
   logical_plan EmptyRelation
   physical_plan EmptyExec
   ```
   


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

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