mohammadnaqvi04 opened a new pull request, #25391: URL: https://github.com/apache/datafusion/pull/25391
## Which issue does this PR close? - Part of #24960. ## Rationale for this change See #24960. This is a split of #25008, which originally covered `EXISTS`/`NOT EXISTS`/`IN`/`NOT IN` together. That PR has been split into two smaller PRs between this one for `EXISTS`/`NOT EXISTS` and a (to come) follow-up stacked on top of it for `IN`/`NOT IN`. ## What changes are included in this PR? Correlated `EXISTS`/`NOT EXISTS` subqueries had count-bug compensation available but never turned it on. * Turn on count-bug compensation for correlated `EXISTS`/`NOT EXISTS` subqueries. * When compensation is needed, decorrelate into a `LEFT JOIN` and substitute the correct value instead of dropping the row. * Make unsupported join shapes fail loudly instead of silently falling back to incorrect behavior. `IN`/`NOT IN` compensation is out of scope for this PR and returns an explicit "not implemented" error. This will be covered by the follow-up PR. ## What is the testing strategy for this PR? Added twenty sqllogictest cases in `subquery.slt`. Ran all `datafusion`, `datafusion-cli`, and `datafusion-sqllogictest` suites, and `./dev/rust_lint.sh`. Also differentially fuzz-tested against DuckDB with a standalone harness, and did several adversarial review passes with Claude to look for gaps beyond the fuzzer's generated shapes. ## Are there any user-facing changes? None, except in the sense that this fixes a user-visible bug. ## AI Usage _AI was used during development of this PR, primarily to help review the test suite and verify test cases against the implemented fix._ -- 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]
