tlfua commented on PR #27783:
URL: https://github.com/apache/datafusion/pull/27783#issuecomment-7249720051

   To check queries deeper than two levels, I ran a three-way comparison in CI 
between main (053386b43480bfbf1a09e9ac3d03b5ca9fafe501), this PR 
(3605ae0bcdd910c90592b9e596cab29f0ca5bb91) and DuckDB 2.0.1: 
https://github.com/tlfua/datafusion/actions/runs/46217032638
   
   The generator, runner and workflow are on 
https://github.com/tlfua/datafusion/tree/ci/27691-deep-sweep . The cases were 
generated and run with AI assistance.
   
   The generator produced 7294 queries. I kept the 836 that return rows on main 
or on this PR for at least one dataset. The other queries give an error on 
both, mostly "Physical plan does not support logical expression". Each kept 
query ran on 3 datasets (two with an empty table), 5 times on each binary:
   
   | Shape | Both correct | Error on main, correct on PR |
   |---|---|---|
   | 3 to 5 wrappers (projection, filter, alias, sort, distinct, window, limit, 
join) between the correlated aggregate and the subquery | 291 | 1122 |
   | 2 or 3 stacked joins in that chain | 0 | 834 |
   | 3 or 4 levels of nested subqueries, each level correlated only to its 
direct outer query | 180 | 0 |
   | Two correlated subqueries of these shapes in one query | 15 | 66 |
   
   - No query that is correct on main fails or gives different rows on this PR.
   - This PR gives no wrong rows, and no query gives different results across 
runs.
   - The 2022 fixed cases all fail on main with the same `No field named ...` 
error as this issue. For example:
   
     ```sql
     SELECT t.a FROM t WHERE EXISTS (SELECT 1 FROM (
       SELECT w2.v FROM (SELECT w1.v FROM (SELECT w0.v FROM (
         SELECT i.b AS v FROM i WHERE i.a = t.a) w0) w1 CROSS JOIN u u1) w2
       LEFT JOIN u u2 ON u2.c > w2.v) s);
     ```
   
     Main fails with `Schema error: No field named w1.a`. This PR returns the 
same rows as DuckDB.
   


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