You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/01/15 08:23:25 UTC

[GitHub] [arrow-datafusion] xudong963 commented on pull request #1566: fix: sql planner creates cross join instead of inner join from select predicates

xudong963 commented on pull request #1566:
URL: https://github.com/apache/arrow-datafusion/pull/1566#issuecomment-1013642299


   
   
   
   
   ```
   ❯ create table part as select 1 as p_partkey;                                                                                                                                                
   0 rows in set. Query took 0.003 seconds.                                                      
   ❯ create table lineitem as select 1 as l_partkey, 2 as l_suppkey;                             
   0 rows in set. Query took 0.005 seconds.                                                      
   ❯ create table supplier as select 1 as s_suppkey;                                             
   0 rows in set. Query took 0.002 seconds.                                                                                                
   ❯ explain select * from part, supplier, lineitem where p_partkey = l_partkey and s_suppkey = l_suppkey; 
   
   +---------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
   | plan_type     | plan                                                                                                                                               |
   +---------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
   | logical_plan  | Projection: #part.p_partkey, #lineitem.l_partkey, #lineitem.l_suppkey, #supplier.s_suppkey                                                         |
   |               |   Join: #lineitem.l_suppkey = #supplier.s_suppkey                                                                                                  |
   |               |     Join: #part.p_partkey = #lineitem.l_partkey                                                                                                    |
   |               |       TableScan: part projection=Some([0])                                                                                                         |
   |               |       TableScan: lineitem projection=Some([0, 1])                                                                                                  |
   |               |     TableScan: supplier projection=Some([0])                                                                                                       |
   ```


-- 
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-unsubscribe@arrow.apache.org

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