raghavyadav01 commented on PR #26596:
URL: https://github.com/apache/datafusion/pull/26596#issuecomment-6374584539
Verified: `SELECT * FROM t AS x JOIN t AS y ON x.a = ANY (SELECT b FROM s)`
fails on main with `No field named x.a`, and returns the right two rows on your
branch.
Checked the match in `has_outer_ref_to_any` is complete — `Exists`,
`InSubquery`, `SetComparison` and `ScalarSubquery` are the only `Expr` variants
carrying a `Subquery`.
Tests cover `= ANY`, `> ALL`, `EXISTS`, `NOT EXISTS`, `IN` and the
nested-in-`OR` case, which is good. The one arm with no test is
`ScalarSubquery`, and I could not reach it: a correlated scalar subquery in a
`JOIN ON` is rejected by the Analyzer ("can only be used in Projection, Filter,
Aggregate and MERGE"), and the `WHERE` route over a `SubqueryAlias` already
works on main. Is it defensive, or is there a shape worth pinning with a test?
One nit: `conjunction(keep_predicates).unwrap()` is safe — if
`push_predicates` is empty then `keep` holds every conjunct — but an `expect()`
saying so would save the next reader the proof.
952 optimizer tests + `subquery.slt` green locally.
--
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]