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/07 08:34:25 UTC

[GitHub] [incubator-doris] wutiangan commented on issue #4162: Doris on es left join 谓词下推bug

wutiangan commented on issue #4162:
URL: https://github.com/apache/incubator-doris/issues/4162#issuecomment-670401413


   @hexian55 
   this is not a bug. In a left join sql stmt,  if the join predicate of on-join-conditions(the join conditions in on clause) is completely bound by the left table, the predicate cannot be pushed down to the base table, but the predicate which is completely bound by the right table can be pushed down to the base table.
   
   for example:
   sql
   >  select * from t1 left join t2 on t1.k1 =  1 and t2.k1 = 1 and t1.k1 = t2.k1
   
   t1 table has only one column
   
   ```
   t1.k1 
   ------
   1      
   2      
   ```
   t2 table has only colum
   ```
   t1.k1
   -----
   1
   3
   ```
   the normal result is 
   ```
   t1.k1  | t2.k1
   -------------
   1      |    1
   2      |  NULLL
   ```
   If t1.k1 = 1 is pushed down to T1, only one record will be returned when scanning T1, and the above SQL will return only one record, this is wrong result, because it should return two rows.
   ```
   t1.k1  | t2.k1
   -------------
   1      |    1
   ```
   


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