jackwener commented on issue #2254:
URL: 
https://github.com/apache/arrow-datafusion/issues/2254#issuecomment-1101936021

   Yes, we just handle the expr in where.
   This rewrite is from spark.
   
   Andrew Lamb ***@***.***> 于 2022年4月19日周二 04:55写道:
   
   > I think this is a *very* subtle area of SQL and it depends on how the
   > expression is being used
   >
   > For example,
   >
   > select * from t1 where c1 > 0;
   >
   > and
   >
   > select * from t1 where c1 > 0 and c1 is not null;
   >
   > Are semantically equivalent (produce the same answers), but these are not:
   >
   > select c1 > 0  from t1;
   >
   > and
   >
   > select c1 > 0 and c1 is not null from t1;
   >
   > The reason is that the semantics of the WHERE clause are that only rows
   > that evaluate to true are passed (if the row evaluates to NULL or false
   > then they don't pass).
   >
   > However, in general, you still have to handle the three way logic with
   > NULL -- I am not at all convinced we do this entirely correctly in the
   > expression simplification pass. We should probably have two modes: used
   > in where and used elsewhere or something 🤔
   >
   > —
   > Reply to this email directly, view it on GitHub
   > 
<https://github.com/apache/arrow-datafusion/issues/2254#issuecomment-1101759932>,
   > or unsubscribe
   > 
<https://github.com/notifications/unsubscribe-auth/AHI4SLNVFUPSCQ5WR4SY5RDVFXD3RANCNFSM5TT2L62Q>
   > .
   > You are receiving this because you authored the thread.Message ID:
   > ***@***.***>
   >
   


-- 
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...@arrow.apache.org

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

Reply via email to