comphead commented on issue #3248:
URL: 
https://github.com/apache/arrow-datafusion/issues/3248#issuecomment-1235749611

   The problem is 
   ```
   ❯ create view v as select 1 as a, 2 as b, 3 as c;
   0 rows in set. Query took 0.001 seconds.
   ❯ explain select * from (select b from v);
   +---------------+---------------------------------------+
   | plan_type     | plan                                  |
   +---------------+---------------------------------------+
   | logical_plan  | Projection: #v.b                      |
   |               |   TableScan: v projection=[b]         |
   | physical_plan | ProjectionExec: expr=[b@0 as b]       |
   |               |   ProjectionExec: expr=[b@0 as b]     |
   |               |     ProjectionExec: expr=[2 as b]     |
   |               |       EmptyExec: produce_one_row=true |
   |               |                                       |
   +---------------+---------------------------------------+
   ```
   The same for table 
   ```
   ❯ create table  v1 as select 1 as a, 2 as b, 3 as c;
   +---+---+---+
   | a | b | c |
   +---+---+---+
   | 1 | 2 | 3 |
   +---+---+---+
   1 row in set. Query took 0.003 seconds.
   ❯ explain select * from (select b from v1);
   +---------------+-------------------------------------------------+
   | plan_type     | plan                                            |
   +---------------+-------------------------------------------------+
   | logical_plan  | Projection: #v1.b                               |
   |               |   TableScan: v1 projection=[b]                  |
   | physical_plan | ProjectionExec: expr=[b@0 as b]                 |
   |               |   MemoryExec: partitions=1, partition_sizes=[1] |
   |               |                                                 |
   +---------------+-------------------------------------------------+
   ```
   @andygrove afaik those physical plans should be the same? 


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