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


   ```
   > CREATE EXTERNAL TABLE customer STORED AS CSV LOCATION 
'/Users/bytedance/arrow-datafusion/datafusion/tests/customer.csv';
   0 rows in set. Query took 0.014 seconds.
   > explain select * from customer as a join (select * from customer as b) on 
a.column_1=b.column_1;
   Plan("subquery in FROM must have an alias")
   > explain select * from customer as a join (select * from customer) as b on 
a.column_1=b.column_1;
   
+---------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | plan_type     | plan                                                       
                                                                                
                                              |
   
+---------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | logical_plan  | Projection: #a.column_1, #a.column_2, #b.column_1, 
#b.column_2                                                                     
                                                      |
   |               |   Join: #a.column_1 = #b.column_1                          
                                                                                
                                              |
   |               |     TableScan: a projection=Some([0, 1])                   
                                                                                
                                              |
   |               |     Projection: #customer.column_1, #customer.column_2     
                                                                                
                                              |
   |               |       TableScan: customer projection=Some([0, 1])          
                                                                                
                                              |
   | physical_plan | ProjectionExec: expr=[column_1@0 as column_1, column_2@1 
as column_2, column_1@2 as column_1, column_2@3 as column_2]                    
                                                |
   |               |   CoalesceBatchesExec: target_batch_size=4096              
                                                                                
                                              |
   |               |     HashJoinExec: mode=Partitioned, join_type=Inner, 
on=[(Column { name: "column_1", index: 0 }, Column { name: "column_1", index: 0 
})]                                                 |
   |               |       CoalesceBatchesExec: target_batch_size=4096          
                                                                                
                                              |
   |               |         RepartitionExec: partitioning=Hash([Column { name: 
"column_1", index: 0 }], 12)                                                    
                                              |
   |               |           RepartitionExec: 
partitioning=RoundRobinBatch(12)                                                
                                                                              |
   |               |             CsvExec: 
source=Path(/Users/bytedance/arrow-datafusion/datafusion/tests/customer.csv: 
[/Users/bytedance/arrow-datafusion/datafusion/tests/customer.csv]), 
has_header=false   |
   |               |       CoalesceBatchesExec: target_batch_size=4096          
                                                                                
                                              |
   |               |         RepartitionExec: partitioning=Hash([Column { name: 
"column_1", index: 0 }], 12)                                                    
                                              |
   |               |           ProjectionExec: expr=[column_1@0 as column_1, 
column_2@1 as column_2]                                                         
                                                 |
   |               |             RepartitionExec: 
partitioning=RoundRobinBatch(12)                                                
                                                                            |
   |               |               CsvExec: 
source=Path(/Users/bytedance/arrow-datafusion/datafusion/tests/customer.csv: 
[/Users/bytedance/arrow-datafusion/datafusion/tests/customer.csv]), 
has_header=false |
   
+---------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   2 rows in set. Query took 0.010 seconds.


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


Reply via email to