Repository navigation
EXPLAIN VERBOSE only works when format is set to (non-default) 'indent' #17480
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
On the datafusion-cli, tree was made the default explain format in this PR. Now, when we use EXPLAIN VERBOSE, we simply get the regular output of explain format tree, which isn't verbose.
To Reproduce
cd datafusion-cli
cargo run
> explain verbose select max(1 + 3);
+---------------+-------------------------------+
| plan_type | plan |
+---------------+-------------------------------+
| physical_plan | ┌───────────────────────────┐ |
| | │ AggregateExec │ |
| | │ -------------------- │ |
| | │ aggr: │ |
| | │ max(Int64(1) + Int64(3)) │ |
| | │ │ |
| | │ mode: Single │ |
| | └─────────────┬─────────────┘ |
| | ┌─────────────┴─────────────┐ |
| | │ PlaceholderRowExec │ |
| | └───────────────────────────┘ |
| | |
+---------------+-------------------------------+To workaround this, the user has to manually set the format option to indent to get the desired verbose explain output
set datafusion.explain.format = 'indent';
> explain verbose select max(1 + 3);Expected behavior
Since only indent is supported for explain verbose, I think it would be nice to just override the explain format to indent when verbose is specified.
+------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
| plan_type | plan |
+------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
| initial_logical_plan | Projection: max(Int64(1) + Int64(3)) |
| | Aggregate: groupBy=[[]], aggr=[[max(Int64(1) + Int64(3))]] |
| | EmptyRelation: rows=1 |
| logical_plan after resolve_grouping_function | SAME TEXT AS ABOVE |
| logical_plan after type_coercion | SAME TEXT AS ABOVE
| analyzed_logical_plan | SAME TEXT AS ABOVE |
| logical_plan after eliminate_nested_union | SAME TEXT AS ABOVE |
| logical_plan after simplify_expressions | Projection: max(Int64(1) + Int64(3))
...
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
petern48 commentedon Sep 9, 2025
take
2010YOUY01 commentedon Sep 9, 2025
Good idea! Perhaps we can override
EXPLAIN ANALYZEtoo?petern48 commentedon Sep 9, 2025
That's a good idea, too! I tried it in the cli, and
explain analyzealready overrides toindent. The code is a little different, so it happens naturally, whereas we need to override it explicitly forexplain verbose.