peter-toth opened a new pull request #28318:
URL: https://github.com/apache/spark/pull/28318


   ### What changes were proposed in this pull request?
   
   This PR fixes a CTE substitution issue so as to the following SQL return the 
correct empty result:
   ```
   WITH t(c) AS (SELECT 1)
   SELECT * FROM t
   WHERE c IN (
     WITH t(c) AS (SELECT 2)
     SELECT * FROM t
   )
   ```
   Before this PR the result was `1`.
   
   ### Why are the changes needed?
   To fix a correctness issue.
   
   ### Does this PR introduce any user-facing change?
   Yes, fixes the correctness issue.
   
   ### How was this patch tested?
   Added new test case.


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

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