Repository navigation
Implement tree explain for ProjectionExec #15023
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Is your feature request related to a problem or challenge?
@irenjj added a new tree explain mode in #14677. Now we need to add support for different types of operators.
Here is an example of how to see the new explain plans:
set datafusion.explain.format = 'tree';
create table foo(x int, y int) as values (1,2), (3,4);
explain select * from foo where x = 4;
+---------------+------------------------------------+
| plan_type | plan |
+---------------+------------------------------------+
| logical_plan | Filter: foo.x = Int32(4) |
| | TableScan: foo projection=[x, y] |
| physical_plan | ┌───────────────────────────┐ |
| | │ CoalesceBatchesExec │ |
| | └─────────────┬─────────────┘ |
| | ┌─────────────┴─────────────┐ |
| | │ FilterExec │ |
| | └─────────────┬─────────────┘ |
| | ┌─────────────┴─────────────┐ |
| | │ DataSourceExec │ |
| | │ -------------------- │ |
| | │ partition_sizes: [1] │ |
| | │ partitions: 1 │ |
| | └───────────────────────────┘ |
| | |
+---------------+------------------------------------+Describe the solution you'd like
Add tree format to the ExecutionPlan specified in the subject of this ticket
Note that the tree mode should have only the most relevant information for users to understand what plan is being run. Detailed iformation
The process goes like:
- Add the relevant code to the operator
- Add / update explain_tree.slt test to show the new code in action
The relevant code looks like this
DisplayFormatType::TreeRender => {
// TODO: collect info
write!(f, "")?;
}You can run the tests like
cargo test --test sqllogictests -- explain_treeYou can update the test like this:
cargo test --test sqllogictests -- explain_tree --completeDescribe alternatives you've considered
Here is an example PR that shows what is needed
Additional context
Since this is well specified and has several examples and will give exposure to DataFusion code and testing, I have marked this as a good first issue
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Activity
Elctrony commentedon Mar 5, 2025
Take
Elctrony commentedon Mar 6, 2025
Can I DM one of the mentors regarding this issue?
alamb commentedon Mar 6, 2025
In general, development on DataFusion happens following the Apache Way, that is in the open as much as possible. If you have a question, perhaps you can ask it here on the ticket and we'll find community feedback
Standing-Man commentedon Mar 10, 2025
Hi @alamb, this issue has been completed and should be closed to avoid any ambiguity, thank you.
alamb commentedon Mar 10, 2025
Thank you @Standing-Man -- you are right we closed it in
ProjectionExec#15082