alamb commented on issue #2181:
URL: 
https://github.com/apache/arrow-datafusion/issues/2181#issuecomment-1093135208

   @jackwener  I am not sure about the need for `Query` -- if there is one, 
perhaps we can combine it with what @andygrove  is working on in 
https://github.com/apache/arrow-datafusion/pull/2172
   
   I was imagining that a query like this
   
   ```sql
   SELECT f.x, sq.a FROM foo as f JOIN (select a from bar) as sq ON (f.x = 
sq.a),
   ```
   
   results in a logical plan like this:
   ```
   Projection(f.x, sq.a)
     --> Join(Inner f.x = sq.a)
       --> TableScan(foo)
       --> Projection(a)  <--- Here is where the "subquery"'s LogicalPlan is 
attached 
         --> TableScan(bar)
   ```
   
   Similarly for
   ```sql
   SELECT f.x  FROM foo as f WHERE f.x IN  (select a from bar) as sq;
   ```
   
   results in a logical plan like this:
   ```
   Projection(f.x, sq.a)
     --> Join(Semi f.x = sq.a)
       --> TableScan(foo)
       --> Projection(a)  <--- Here is where the "subquery"'s LogicalPlan is 
attached 
         --> TableScan(bar)
   ```


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