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/04/08 17:52:05 UTC

[GitHub] [arrow-datafusion] alamb commented on issue #2181: [Discuss] Add struct `Query` for datafusion

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

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