akshatsinghrajawat opened a new pull request, #27881:
URL: https://github.com/apache/datafusion/pull/27881

   ## Which issue does this PR close?
   
   This PR does not close #27801. It adds a regression test for the case 
described in that issue. The underlying bug is still present.
   
   ## Rationale for this change
   
   I added a test to 
`datafusion/sqllogictest/test_files/subquery_decorrelation.slt` for the 
correlated `EXISTS` case described in #27801.
   
   The subquery contains a join whose `ON` condition references a column from 
the outer query through the alias `o`:
   
   ```sql
   SELECT o.a FROM t o WHERE EXISTS (
       SELECT 1 FROM i JOIN u ON u.b > o.a * 5
   ) ORDER BY o.a;
   ```
   
   The issue reports that DuckDB 2.0.1 returns `1` and `2` for the supplied 
test data. DataFusion currently fails while running the `simplify_expressions` 
optimizer rule, with a schema error because it cannot resolve `o.a`.
   
   I recorded the current DataFusion error as the expected error in the SQL 
logic test, and included the expected DuckDB rows in a comment. This adds 
coverage for the failing case without changing the current optimizer behavior.
   
   This is a test-only change. It does not implement a fix for #27801.
   
   ## Testing
   
   I ran the `subquery_decorrelation` SQL logic test successfully. I also ran 
it with `--complete` to capture the current error output.


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