Skip to content

explain verbose doesn't include the output of all optimizer passes #497

Closed

Description

@alamb

Describe the bug
explain verbose does not appear to show the output of each optimizer pass, nor does it seem to show pushed down predicates in the physical plan

To Reproduce

echo "true" > /tmp/foo.csv
cargo run -p datafusion-cli --no-default-features

Then run this SQL:

CREATE EXTERNAL TABLE foo(bar boolean)
STORED AS CSV
LOCATION '/tmp/foo.csv';
0 rows in set. Query took 0 seconds.
> explain verbose select * from foo where bar = true;
+-----------------------------------------+--------------------------------------------------------------------------+
| plan_type                               | plan                                                                     |
+-----------------------------------------+--------------------------------------------------------------------------+
| logical_plan                            | Projection: #bar                                                         |
|                                         |   Filter: #bar Eq Boolean(true)                                          |
|                                         |     TableScan: foo projection=None                                       |
| logical_plan after projection_push_down | Projection: #bar                                                         |
|                                         |   Filter: #bar Eq Boolean(true)                                          |
|                                         |     TableScan: foo projection=Some([0])                                  |
| logical_plan after projection_push_down | Projection: #bar                                                         |
|                                         |   Filter: #bar Eq Boolean(true)                                          |
|                                         |     TableScan: foo projection=Some([0])                                  |
| physical_plan                           | ProjectionExec: expr=[bar]                                               |
|                                         |   FilterExec: bar = true                                                 |
|                                         |     CsvExec: source=Path(/tmp/foo.csv: [/tmp/foo.csv]), has_header=false |
+-----------------------------------------+--------------------------------------------------------------------------+

Expected behavior
I expect to see plans after filter pushdown and constant folding. Instead I see two entries for logical_plan after projection_push_down which does not seem right

Additional context
Add any other context about the problem here.

Activity

  1. added
    bugSomething isn't working
    on Jun 3, 2021
  2. alamb commented on Jun 3, 2021

    @alamb
    ContributorAuthor
  3. alamb commented on Jul 19, 2021

    @alamb
    ContributorAuthor

    dupe of #733

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions