namanjain24-sudo commented on PR #26596: URL: https://github.com/apache/datafusion/pull/26596#issuecomment-6375331131
> The one arm with no test is `ScalarSubquery`, and I could not reach it [...] Is it defensive, or is there a shape worth pinning with a test? It is reachable, but nothing observable depends on it. `ScalarSubqueryToJoin` declines on a non-equality correlation and on an inner `LIMIT`, so in those shapes the `ScalarSubquery` survives every logical pass and the `Filter` is still sitting directly on the `SubqueryAlias` by the time `PushDownFilter` runs: ```sql SELECT * FROM (SELECT a FROM t) AS x WHERE (SELECT max(s.b) FROM s WHERE s.b > x.a) = 1; SELECT * FROM (SELECT a FROM t) AS x WHERE (SELECT s.b FROM s WHERE s.b = x.a LIMIT 1) = 1; ``` Both reach the arm, and both end at `This feature is not implemented: Physical plan does not support logical expression ScalarSubquery` — identically with and without this change. I reverted just `push_down_filter.rs` to main (recompiling optimizer through sqllogictest) and got the same two failures with the same message, while the `OR` and plain-correlated shapes passed either way. So the guard moves where the filter sits and nothing else downstream notices. I couldn't construct a shape where dropping that arm changes the result, so a test there would only be asserting an unrelated "not implemented" — I'd leave it as is. -- 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]
