You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support dot graph output in explain (analyze) #3606
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
We support converting a logical plan to a dot language graph (.dot) - I believe Ballista also supports it (by @andygrove ?) It would be great to support this as format for explain analyze
@Dandandan Since you asked, I have a PR open against Ballista related to DOT graphs - apache/datafusion-ballista#242. Feel free to review if you like. I would love to get this merged soon.
Related but not 100% same topic as original issue - happy to take the conversation elsewhere if you prefer:
I'm interested in Dalibo visualizations because the UI is quite powerful. Unless I'm mistaken display_pg_json introduced in #9789 only applies to LogicalPlan and cannot be leveraged for execution plans and execution metrics.
Is there any plan on adding more physical plan display implementations, for example the ExecutionPlan equivalent of display_pg_json / would you be open to contributions on this end ?
Is there any plan on adding more physical plan display implementations, for example the ExecutionPlan equivalent of display_pg_json / would you be open to contributions on this end ?
There is no plan that I know of. From my point of view, this seems like a good addition as long as it doesn't add (very much) additional overhead / API churn
Activity
[-]Support dot graph in explain (analyze)[/-][+]Support dot graph output in explain (analyze)[/+]alamb commentedon Sep 25, 2022
There is already a code to make
graphvizformat here: https://github.com/apache/arrow-datafusion/blob/81b57948778cfa485d8b3f2c1fe4485f3966e8e4/datafusion/expr/src/logical_plan/plan.rs#L604-L633It might be kind of old / out of date, so might need to be updated
Perhaps we could add some new configuration option like "show_graphviz_during_explain" whihc if true would also output the graphviz output?
Dandandan commentedon Sep 25, 2022
My plan is to use the presto syntax
EXPLAIN [ANALYZE] [FORMAT GRAPHVIZ|JSON|TEXT]to control the output, which should default to TEXT (current output).
Dandandan commentedon Sep 25, 2022
Added a PR for the syntax in here apache/datafusion-sqlparser-rs#621
andygrove commentedon Sep 26, 2022
@Dandandan Since you asked, I have a PR open against Ballista related to DOT graphs - apache/datafusion-ballista#242. Feel free to review if you like. I would love to get this merged soon.
alamb commentedon Sep 27, 2022
I'll try and get a sqlparser-rs release out in the next day or two
mkmik commentedon Sep 27, 2022
There are many visualizers that can process the postgres explain JSON format (e.g. https://github.com/dalibo/pev2 or https://github.com/mgartner/pg_flame)
alamb commentedon Sep 28, 2022
https://crates.io/crates/sqlparser/0.24.0 has been released
liurenjie1024 commentedon May 25, 2023
Hi, @Dandandan are you still working on this?
liurenjie1024 commentedon Jun 13, 2023
@alamb Seems @Dandandan not responding, I will go on with this issue, please assign it to me.
alamb commentedon Jun 13, 2023
Thanks @liurenjie1024
Dandandan commentedon Jun 13, 2023
Hey @liurenjie1024 , yes feel free to work on it. Thank you @liurenjie1024
16pierre commentedon Apr 24, 2025
Related but not 100% same topic as original issue - happy to take the conversation elsewhere if you prefer:
I'm interested in Dalibo visualizations because the UI is quite powerful. Unless I'm mistaken
display_pg_jsonintroduced in #9789 only applies toLogicalPlanand cannot be leveraged for execution plans and execution metrics.Is there any plan on adding more physical plan display implementations, for example the
ExecutionPlanequivalent ofdisplay_pg_json/ would you be open to contributions on this end ?alamb commentedon Apr 28, 2025
We have made the explain formats available via SQL now in DataFusion 47. See docs here: https://datafusion.apache.org/user-guide/sql/explain.html#id1
There is no plan that I know of. From my point of view, this seems like a good addition as long as it doesn't add (very much) additional overhead / API churn
THanks @16pierre
tomsanbear commentedon Oct 29, 2025
test