suibianwanwank commented on PR #15281: URL: https://github.com/apache/datafusion/pull/15281#issuecomment-2764503913
> ``` >After `SimplifyExpressions`, we know e2.b = 2.b + 1 is false, since they are the same column. And, then we can infer taht >max(e2.a) is NULL. >select e.b ,(select case when max(e2.a) > 10 then 'a' else 'b' end from t e2 where e2.b = e.b+1 ) from t e; > ``` @jayzhan211 This doesn't seem entirely correct; even with the same table, we can't guarantee that b and b+1 can't match. This is illustrated by the example you gave earlier, where b+1 might match to a different line than itself. ```sql statement count 0 create table t(a int, b int) as values (11, 2), (3, 0); statement count 0 create table t2(a int, b int) as values (11, 3), (12, 1); ``` -- 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