HaoYang670 opened a new issue, #3355:
URL: https://github.com/apache/arrow-datafusion/issues/3355

   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   A clear and concise description of what the problem is. Ex. I'm always 
frustrated when [...] 
   ```
   ❯ create view v as select 1 as a, 2 as b, 3 as c;
   0 rows in set. Query took 0.010 seconds.
   ❯ explain select * from v offset 0 limit 2;
   +---------------+-------------------------------------------------------+
   | plan_type     | plan                                                  |
   +---------------+-------------------------------------------------------+
   | logical_plan  | Limit: skip=0, fetch=2                                |
   |               |   Projection: #v.a, #v.b, #v.c                        |
   |               |     TableScan: v projection=[a, b, c], fetch=2        |
   | physical_plan | GlobalLimitExec: skip=0, fetch=2                      |
   |               |   ProjectionExec: expr=[a@0 as a, b@1 as b, c@2 as c] |
   |               |     ProjectionExec: expr=[1 as a, 2 as b, 3 as c]     |
   |               |       EmptyExec: produce_one_row=true                 |
   |               |                                                       |
   +---------------+-------------------------------------------------------+
   ❯ explain select * from v limit 2;
   +---------------+-------------------------------------------------------+
   | plan_type     | plan                                                  |
   +---------------+-------------------------------------------------------+
   | logical_plan  | Limit: skip=None, fetch=2                             |
   |               |   Projection: #v.a, #v.b, #v.c                        |
   |               |     TableScan: v projection=[a, b, c], fetch=2        |
   | physical_plan | GlobalLimitExec: skip=None, fetch=2                   |
   |               |   ProjectionExec: expr=[a@0 as a, b@1 as b, c@2 as c] |
   |               |     ProjectionExec: expr=[1 as a, 2 as b, 3 as c]     |
   |               |       EmptyExec: produce_one_row=true                 |
   |               |                                                       |
   +---------------+-------------------------------------------------------+
   ```
   
   I'd like `explain select * from v offset 0 limit 2` and `explain select * 
from v limit 2;` to have same logical plan. 
   
   Also, in `eliminate_limit.rs`, we should eliminate the `Limit` plan when 
`fetch = None` and `skip = 0 or skip = None`.
   **Describe the solution you'd like**
   A clear and concise description of what you want to happen.
   
   **Describe alternatives you've considered**
   We could not do this.
   
   **Additional context**
   Add any other context or screenshots about the feature request here.
   


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