raghavyadav01 commented on issue #24960:
URL: https://github.com/apache/datafusion/issues/24960#issuecomment-6506156269

   Checked on current main (14aa185dd):
   
   - The `EXISTS` / `NOT EXISTS` repro in the description is correct now (`1, 
2, 3` and no rows, same as DuckDB 1.5.6)
   - The three `IN` queries from 
https://github.com/apache/datafusion/issues/24960#issuecomment-6367423894 now 
fail with `Physical plan does not support logical expression InSubquery` 
instead of returning wrong rows
   
   One shape still returns wrong rows, a `HAVING` that reads both the count and 
an outer column:
   
   ```sql
   CREATE TABLE t1(t1_int INT) AS VALUES (1), (2), (3);
   CREATE TABLE t2(t2_int INT) AS VALUES (2);
   SELECT t1_int FROM t1 WHERE EXISTS (SELECT count(*) FROM t2 WHERE t1.t1_int 
= t2.t2_int HAVING count(*) + t1.t1_int > 1);
   -- main: 2, DuckDB: 2, 3
   SELECT t1_int FROM t1 WHERE NOT EXISTS (SELECT count(*) FROM t2 WHERE 
t1.t1_int = t2.t2_int HAVING count(*) + t1.t1_int > 1);
   -- main: 1, 3, DuckDB: 1
   ```
   
   It looks related to #26695, but that one is about a `HAVING` on outer 
columns only, so I'd keep this open for now.
   


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