ygf11 commented on issue #1835:
URL: 
https://github.com/apache/arrow-datafusion/issues/1835#issuecomment-1455395265

   I think this has already done. 
   
   ```sql
   ❯ explain select t1_id from t1 where t1_id in (select t2_id from t2);
   
+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
   | plan_type     | plan                                                       
                                                                                
     |
   
+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
   | logical_plan  | LeftSemi Join: t1.t1_id = __correlated_sq_1.t2_id          
                                                                                
     |
   |               |   TableScan: t1 projection=[t1_id]                         
                                                                                
     |
   |               |   SubqueryAlias: __correlated_sq_1                         
                                                                                
     |
   |               |     Projection: t2.t2_id AS t2_id                          
                                                                                
     |
   |               |       TableScan: t2 projection=[t2_id]                     
                                                                                
     |
   ...
   ❯ explain select t1_id from t1 where t1_id in (select t2_id from t2 where 
t2_int > t1_int);
   
+---------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | plan_type     | plan                                                       
                                                                                
                                                                                
                                |
   
+---------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | logical_plan  | Projection: t1.t1_id                                       
                                                                                
                                                                                
                                |
   |               |   LeftSemi Join: t1.t1_id = __correlated_sq_2.t2_id 
Filter: __correlated_sq_2.t2_int > t1.t1_int                                    
                                                                                
                                       |
   |               |     TableScan: t1 projection=[t1_id, t1_int]               
                                                                                
                                                                                
                                |
   |               |     SubqueryAlias: __correlated_sq_2                       
                                                                                
                                                                                
                                |
   |               |       Projection: t2.t2_id AS t2_id, t2.t2_int             
                                                                                
                                                                                
                                |
   |               |         TableScan: t2 projection=[t2_id, t2_int]
   ```
   
   
   


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