alpaylan commented on issue #26573:
URL: https://github.com/apache/datafusion/issues/26573#issuecomment-6354410819

   Hi @AdamGS 
   
   It looks different. I built #25273 at its head (02028678d) and ran both 
repros:
   
   - #25258's queries now give the right rows (`> ANY` returns ids 2-6, `= ANY` 
returns 1, 2).
   - The query here still fails the same way:
     `SELECT * FROM t2 AS a JOIN t1 AS b ON a.c0 = ANY (SELECT c0 FROM t1);`
     -> `Optimizer rule 'simplify_expressions' failed ... No field named a.c0. 
Did you mean 't2.c0'?`
   
   The difference, as far as I can tell: here the predicate sits in a `JOIN ... 
ON` over an aliased table, and `push_down_filter` moves it below the 
`SubqueryAlias` (rewriting `a.c0` to `t2.c0` in the predicate itself) without 
rewriting the subquery's outer reference, which still says `a.c0`. Without the 
alias, or with the same predicate in `WHERE`, it works. #25258 is the unaliased 
same-table case in decorrelation, so the two touch different rules.
   


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