lgingerich commented on issue #27768:
URL: https://github.com/apache/datafusion/issues/27768#issuecomment-7286710955

   This bug is fixed by #27783 which was merged yesterday, and this issue can 
now be closed.
   
   To reproduce verification of the bug fix, build with `datafusion = { git = 
"https://github.com/apache/datafusion";, rev = "ff5f25375" }`, run `cargo run -p 
datafusion-cli`, then execute all SQL queries in the initial message above.
   
   Below is my terminal output from doing these steps. The three failing 
queries now execute successfully and match the results of the analogous query 
rewrites given above.
   
   ```
   DataFusion CLI v57.0.0-dev
   > SELECT version();
   +------------------------------------------------+
   | version()                                      |
   +------------------------------------------------+
   | Apache DataFusion 57.0.0-dev, aarch64 on macos |
   +------------------------------------------------+
   1 row(s) fetched. 
   Elapsed 0.026 seconds.
   
   > CREATE TABLE l(k INT) AS VALUES (1), (2), (3);
   0 row(s) fetched. 
   Elapsed 0.012 seconds.
   
   > CREATE TABLE r(k INT, v INT) AS VALUES (1, 10), (1, 11), (2, 20);
   0 row(s) fetched. 
   Elapsed 0.010 seconds.
   
   > SELECT k FROM l WHERE EXISTS (SELECT r.v FROM r WHERE r.k = l.k EXCEPT 
SELECT 10) ORDER BY k;
   +---+
   | k |
   +---+
   | 1 |
   | 2 |
   +---+
   2 row(s) fetched. 
   Elapsed 0.028 seconds.
   
   > SELECT k FROM l WHERE EXISTS (SELECT r.v FROM r WHERE r.k = l.k INTERSECT 
SELECT 10) ORDER BY k;
   +---+
   | k |
   +---+
   | 1 |
   +---+
   1 row(s) fetched. 
   Elapsed 0.010 seconds.
   
   > SELECT k FROM l WHERE k IN (SELECT r.k FROM r WHERE r.v > l.k EXCEPT 
SELECT 1) ORDER BY k;
   +---+
   | k |
   +---+
   | 2 |
   +---+
   1 row(s) fetched. 
   Elapsed 0.012 seconds.
   
   > SELECT k FROM l WHERE EXISTS (SELECT 1 FROM r WHERE r.k = l.k AND r.v <> 
10) ORDER BY k;
   +---+
   | k |
   +---+
   | 1 |
   | 2 |
   +---+
   2 row(s) fetched. 
   Elapsed 0.009 seconds.
   
   > SELECT k FROM l WHERE EXISTS (SELECT 1 FROM r WHERE r.k = l.k AND r.v = 
10) ORDER BY k;
   +---+
   | k |
   +---+
   | 1 |
   +---+
   1 row(s) fetched. 
   Elapsed 0.012 seconds.
   
   > SELECT k FROM l WHERE k IN (SELECT r.k FROM r WHERE r.v > l.k AND r.k <> 
1) ORDER BY k;
   +---+
   | k |
   +---+
   | 2 |
   +---+
   1 row(s) fetched. 
   Elapsed 0.011 seconds.
   
   > SELECT k FROM l WHERE EXISTS (SELECT r.v, r.k FROM r WHERE r.k = l.k 
EXCEPT SELECT 10, 1) ORDER BY k;
   
   +---+
   | k |
   +---+
   | 1 |
   | 2 |
   +---+
   2 row(s) fetched. 
   Elapsed 0.017 seconds.
   
   >  \? for help, \q to quit
   
   ```


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