-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 different EXPLAIN
formats via SQL
#15021
Comments
getting json output may be sufficient, we could derive SVG from it if needed |
I can implement the JSON part |
I was thinking about implementing this feature I think it would be a relatively straightforward implementation:
Then we would just need to update the code in planning: datafusion/datafusion/sql/src/statement.rs Line 177 in da42933
|
as mentioned in #14914 (comment) ballista uses graphviz-rust which generates those sub-optimal images (and needs local graph viz installation). spark uses a javascript framework which works much better for them. Maybe we should keep |
I so want this feature (and I would like an excuse to write some code) I am going to take a shot at doing so |
I have two PRs to implement this feature |
Thank you @alamb, and apologize for postponing this so long 🙈 (excuse: keeping receiving unscheduled prioritiiii things from @killme2008 |
LOL I totally understand. I happened to have some time and wanted some excuse to write some code :) (Thanks for the review!) |
Is your feature request related to a problem or challenge?
Suggested by @waynexia #14914 (comment)
Currently, DataFusion supports
EXPLAIN
andEXPLAIN ANALYZE
as documented here: https://datafusion.apache.org/user-guide/sql/explain.html#id1Both those commands produce a text based explain format:
DataFusion has at least three other text based ways to generate explain plans:
displayable::graphviz
SQL EXPLAIN
Tree Rendering #14914Also, @milenkovicm suggested on #14914 (comment) that getting an SVG version would also be useful
As of now it is not possible to see those formats via
SQL
(you need to use the API or set a config option)Describe the solution you'd like
I would like to be able to access the different explain formats via SQL
Describe alternatives you've considered
@waynexia suggests (and I agree) on #14914 (comment)
That we follow the
EXPLAIN [ANALYZE] FORMAT <format>
grammar?:So this would look something like
@waynexia suggests on #14914 (comment)
datafusion/datafusion/sql/src/statement.rs
Lines 213 to 222 in ed517ef
However, It seems like AnalyzeFormat currently only supports Text, JSON, and GRAPHVIZ 🤔
https://docs.rs/sqlparser/latest/sqlparser/ast/enum.AnalyzeFormat.html
Additional context
No response
The text was updated successfully, but these errors were encountered: