Skip to content
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

Support dot graph output in explain (analyze) #3606

Open
Dandandan opened this issue Sep 24, 2022 · 11 comments
Open

Support dot graph output in explain (analyze) #3606

Dandandan opened this issue Sep 24, 2022 · 11 comments
Assignees
Labels
enhancement New feature or request

Comments

@Dandandan
Copy link
Contributor

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.html

Describe alternatives you've considered

Additional context

@Dandandan Dandandan added the enhancement New feature or request label Sep 24, 2022
@Dandandan Dandandan changed the title Support dot graph in explain (analyze) Support dot graph output in explain (analyze) Sep 24, 2022
@alamb
Copy link
Contributor

alamb commented Sep 25, 2022

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?

@Dandandan
Copy link
Contributor Author

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
Copy link
Contributor Author

Added a PR for the syntax in here sqlparser-rs/sqlparser-rs#621

@andygrove
Copy link
Member

@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
Copy link
Contributor

alamb commented Sep 27, 2022

I'll try and get a sqlparser-rs release out in the next day or two

@mkmik
Copy link
Contributor

mkmik commented 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
Copy link
Contributor

alamb commented Sep 28, 2022

https://crates.io/crates/sqlparser/0.24.0 has been released

@liurenjie1024
Copy link
Contributor

Hi, @Dandandan are you still working on this?

@liurenjie1024
Copy link
Contributor

@alamb Seems @Dandandan not responding, I will go on with this issue, please assign it to me.

@alamb
Copy link
Contributor

alamb commented Jun 13, 2023

Thanks @liurenjie1024

@Dandandan
Copy link
Contributor Author

Hey @liurenjie1024 , yes feel free to work on it. Thank you @liurenjie1024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants