You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/08/31 08:12:34 UTC

[GitHub] [incubator-doris] WuZixing opened a new issue #4487: [Bug] A predicate after right-anti-join should not be pushed down to the scan node of left table

WuZixing opened a new issue #4487:
URL: https://github.com/apache/incubator-doris/issues/4487


   **Describe the bug**
   The predicate in the following SQL should not be pushed down to the OlapScanNode corresponding to the left table.
   `SELECT * FROM t1 RIGHT ANTI JOIN t0 ON t1.c2 = t0.c2 AND t1.c4 = t0.c3 WHERE true is NULL;`
   
   The result set of this query should be empty. The real execution pushes down the predicate in WHERE clause to the scan node under `t1`, and left table (`t1`) of the right-anti-join would be empty, so all rows from the right table (`t0`) are outputted after join as the result set. 
   
   **To Reproduce**
   Steps to reproduce the behavior:
   1. Create 2 tables:
   
   Schema:
   
   ```
   CREATE TABLE `t0` (
     `c0` tinyint NOT NULL,
     `c1` tinyint NOT NULL
   ) ENGINE=OLAP
   UNIQUE KEY(`c0`, `c1`)
   COMMENT "OLAP"
   DISTRIBUTED BY HASH(`c1`, `c0`) BUCKETS 10
   PROPERTIES (
   "replication_num" = "1",
   "in_memory" = "false",
   "storage_format" = "DEFAULT"
   );
   ```
   
   ```
   CREATE TABLE `t1` (
     `c0` tinyint NOT NULL,
     `c1` tinyint NOT NULL
   ) ENGINE=OLAP
   UNIQUE KEY(`c0`, `c1`)
   COMMENT "OLAP"
   DISTRIBUTED BY HASH(`c1`, `c0`) BUCKETS 10
   PROPERTIES (
   "replication_num" = "1",
   "in_memory" = "false",
   "storage_format" = "DEFAULT"
   );
   ```
   
   Rows:
   
   ```
   insert into t0 (c0,c1) values (1, 2);
   insert into t1 (c0,c1) values (3, 4);
   ```
   
   2. This query will produce a result set of one row `(1,2)`, while it's supposed to be empty:
   
   `SELECT * FROM t1 RIGHT ANTI JOIN t0 ON t1.c0 = t0.c0 AND t1.c1 = t0.c1 WHERE true is NULL;`
   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] xinghuayu007 commented on issue #4487: [Bug] A predicate after right-anti-join should not be pushed down to the scan node of left table

Posted by GitBox <gi...@apache.org>.
xinghuayu007 commented on issue #4487:
URL: https://github.com/apache/incubator-doris/issues/4487#issuecomment-684125630


   which version does this bug appear


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org