Skip to content

Implement tree explain for UnionExec #15278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions datafusion/physical-plan/src/union.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,7 @@ impl DisplayAs for UnionExec {
DisplayFormatType::Default | DisplayFormatType::Verbose => {
write!(f, "UnionExec")
}
DisplayFormatType::TreeRender => {
// TODO: collect info
write!(f, "")
}
DisplayFormatType::TreeRender => Ok(()),
}
}
}
Expand Down
30 changes: 30 additions & 0 deletions datafusion/sqllogictest/test_files/explain_tree.slt
Original file line number Diff line number Diff line change
Expand Up @@ -1541,6 +1541,32 @@ physical_plan
71)│ rows: 1 ││ rows: 1 │
72)└───────────────────────────┘└───────────────────────────┘

# Test explain tree for UnionExec
query TT
EXPLAIN
SELECT id, name FROM t1
UNION ALL
SELECT id, name FROM t2;
----
physical_plan
01)┌───────────────────────────┐
02)│ UnionExec ├──────────────┐
03)└─────────────┬─────────────┘ │
04)┌─────────────┴─────────────┐┌─────────────┴─────────────┐
05)│ DataSourceExec ││ ProjectionExec │
06)│ -------------------- ││ -------------------- │
07)│ bytes: 1320 ││ id: CAST(id AS Int32) │
08)│ format: memory ││ name: name │
09)│ rows: 1 ││ │
10)└───────────────────────────┘└─────────────┬─────────────┘
11)-----------------------------┌─────────────┴─────────────┐
12)-----------------------------│ DataSourceExec │
13)-----------------------------│ -------------------- │
14)-----------------------------│ bytes: 1312 │
15)-----------------------------│ format: memory │
16)-----------------------------│ rows: 1 │
17)-----------------------------└───────────────────────────┘

# cleanup
statement ok
drop table t1;
Expand Down Expand Up @@ -2000,6 +2026,10 @@ physical_plan
58)│ rows: 1 │
59)└───────────────────────────┘

# clean up
statement ok
drop table t1;

# Test explain tree for LazyMemoryExec
query TT
EXPLAIN SELECT * FROM generate_series(1, 100)
Expand Down
Loading