mohammadnaqvi04 commented on PR #25008:
URL: https://github.com/apache/datafusion/pull/25008#issuecomment-5705544648

   @AdamGS Circling back on the `LIMIT 0` and fan-out cases from your last 
comment, both are fixed now. I changed how the subquery's aggregate is grouped 
so that two raw values that equal eachother post-cast don't fan-out anymore. 
   
   ```sql
   > SELECT o.k
   FROM outer_rows o
   WHERE EXISTS (
     SELECT count(*) FROM inner_rows i WHERE i.k = o.k LIMIT 0
   );
   +---+
   | k |
   +---+
   +---+
   0 row(s) fetched.
   Elapsed 0.005 seconds.
   
   > SELECT o.k
   FROM outer_rows o
   WHERE EXISTS (
     SELECT count(*) FROM text_keys i WHERE CAST(i.k AS INT) = o.k
   );
   +---+
   | k |
   +---+
   | 1 |
   +---+
   1 row(s) fetched.
   Elapsed 0.006 seconds.
   ```
   I'm going to split this into two smaller PRs for reviewability: one for 
`EXISTS`/`NOT EXISTS`, then `IN`/`NOT IN` afterward once that one's merged. 
I'll close this PR once the first one is up.


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