Open Dandandan opened 1 year ago
There is already a code to make graphviz
format here: https://github.com/apache/arrow-datafusion/blob/81b57948778cfa485d8b3f2c1fe4485f3966e8e4/datafusion/expr/src/logical_plan/plan.rs#L604-L633
It 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?
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).
Added a PR for the syntax in here https://github.com/sqlparser-rs/sqlparser-rs/pull/621
@Dandandan Since you asked, I have a PR open against Ballista related to DOT graphs - https://github.com/apache/arrow-ballista/pull/242. Feel free to review if you like. I would love to get this merged soon.
I'll try and get a sqlparser-rs release out in the next day or two
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)
https://crates.io/crates/sqlparser/0.24.0 has been released
Hi, @Dandandan are you still working on this?
@alamb Seems @Dandandan not responding, I will go on with this issue, please assign it to me.
Thanks @liurenjie1024
Hey @liurenjie1024 , yes feel free to work on it. Thank you @liurenjie1024
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
Describe the solution you'd like Return the .dot graph output when giving the
FORMAT DOT
as option to explain / explain analyze statements. Amazon Athena has a similar feature: https://docs.aws.amazon.com/athena/latest/ug/athena-explain-statement.htmlDescribe alternatives you've considered
Additional context