Support EXPLAIN ... FORMAT <indent | tree | json | graphviz > ...#15166
Support EXPLAIN ... FORMAT <indent | tree | json | graphviz > ...#15166alamb merged 8 commits intoapache:mainfrom
EXPLAIN ... FORMAT <indent | tree | json | graphviz > ...#15166Conversation
d2e0d63 to
aa53939
Compare
aa53939 to
b23e3cd
Compare
EXPLAIN ... FORMAT <indent | tree | json | graphviz > ...EXPLAIN ... FORMAT <indent | tree | json | graphviz > ...
b23e3cd to
187f38e
Compare
| .. | ||
| } => { | ||
| self.explain_to_plan(verbose, analyze, DFStatement::Statement(statement)) | ||
| let format = format.map(|format| format.to_string()); |
There was a problem hiding this comment.
Not very related to this PR, will we change sqlparser part to use a String instead of enum like here? (I'd prefer so, as it gives us more flexibility)
There was a problem hiding this comment.
I think that would be a fine idea to propose upstream in sqlparser
I am not aware of any plans at the moment
187f38e to
c965e8e
Compare
Co-authored-by: Ruihang Xia <[email protected]>
| TreeRender, | ||
| } | ||
|
|
||
| impl FromStr for DisplayFormatType { |
There was a problem hiding this comment.
This is superceded by the ExplainFormat
| statement ok | ||
| drop table t2; | ||
|
|
||
| ## Tests for explain format |
There was a problem hiding this comment.
Here are the tests showing how this works
|
FYI @irenjj |
…o alamb/explan_format
|
Thanks @alamb ! |
|
I'll take a look at others later today.❤️ |
| displayable(optimized_plan.as_ref()).to_stringified( | ||
| e.verbose, | ||
| FinalPhysicalPlan, | ||
| DisplayFormatType::TreeRender, | ||
| ), |
There was a problem hiding this comment.
Maybe we can add a new function to handle tree explain like display_pg_json, then the third parameter is no longer needed as I found the values passed in below are all default values.
There was a problem hiding this comment.
That is a good idea -- I will try it
There was a problem hiding this comment.
I did it in a83ec4e and i think it looks much nicer ❤️
|
Thanks @alamb , others LGTM. |
This is a good idea -- thank you. I did it in 31f402d |
Which issue does this PR close?
EXPLAINformats via SQL #15021Rationale for this change
I would like to be able to see more of the great explain plan code that DataFusion already has (see #15021 for details)
What changes are included in this PR?
Changes:
EXPLAIN VERBOSE FORMAT ...indentmodetreemodepgjsonmodegraphvizmodeHere is an example
Are these changes tested?
Are there any user-facing changes?