2010YOUY01 opened a new issue, #11275:
URL: https://github.com/apache/datafusion/issues/11275

   ### Describe the bug
   
   There are two similar queries:
   `SELECT [expr1] FROM [tables] where [predicate]`
   `SELECT [expr2] FROM [tables] where [predicate]`
   The only difference is their projection expression, they should return the 
same number of row.
   The following queries return a different number of rows
   
   ### To Reproduce
   
   ```
   CREATE TABLE t0 (v1 BOOLEAN);
   INSERT INTO t0 (v1) VALUES (false), (null);
   
   CREATE TABLE t1 (v1 BOOLEAN);
   INSERT INTO t1 (v1) VALUES (false), (null), (false);
   
   CREATE TABLE t2 (v1 BOOLEAN);
   INSERT INTO t2 (v1) VALUES (false), (true);
   ```
   
   ```
   > SELECT t2.v1, t1.v1 FROM t0, t1, t2 where  t2.v1 IS DISTINCT FROM t0.v1;
   +-------+-------+
   | v1    | v1    |
   +-------+-------+
   | false |       |
   | true  | false |
   | true  |       |
   | true  | false |
   | false |       |
   | true  | false |
   | true  |       |
   | true  | false |
   +-------+-------+
   8 row(s) fetched.
   Elapsed 0.007 seconds.
   
   > SELECT * FROM t0, t1, t2 where  t2.v1 IS DISTINCT FROM t0.v1;
   +-------+-------+-------+
   | v1    | v1    | v1    |
   +-------+-------+-------+
   | false | false | true  |
   | false |       | true  |
   | false | false | true  |
   |       | false | false |
   |       |       | false |
   |       | false | false |
   |       | false | true  |
   |       |       | true  |
   |       | false | true  |
   +-------+-------+-------+
   9 row(s) fetched.
   Elapsed 0.006 seconds.
   ```
   
   ### Expected behavior
   
   _No response_
   
   ### Additional context
   
   Looks like this bug can be further minimized
   
   
   Found by SQLancer https://github.com/apache/datafusion/issues/11030


-- 
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: github-unsubscr...@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to