Support format arguments in EXPLAIN ANALYZE#22733
Conversation
b760bb9 to
78d8af9
Compare
78d8af9 to
4774032
Compare
steveburnett
left a comment
There was a problem hiding this comment.
LGTM! (docs)
Pull branch, local docs build, looks good. Thanks!
|
Suggest revising the release note entry following the Order of changes in the Release Notes Guidelines, also add a link to the existing documentation (I tested this link in a local build): |
| case GRAPHVIZ: | ||
| plan = graphvizDistributedPlan(queryInfo.getOutputStage().get().getSubStages().get(0), functionAndTypeManager, operatorContext.getSession()); |
There was a problem hiding this comment.
Since we are not changing the Graphviz output, should we skip supporting EXPLAIN ANALYZE (FORMAT GRAPHIZ) ? (the output is same as EXPLAIN (FORMAT GRAPHIZ))
IMO, it will only add to confusion for users
There was a problem hiding this comment.
Thanks for your opinion on this one. I had a similar thought but decided to just include it anyways. However, if you think it is confusing I will remove support for it
There was a problem hiding this comment.
Yes, lets skip it for now. We can enhance Graphviz output in a different PR (if there's interest) and add it back
There was a problem hiding this comment.
naive question - why is it hard to add execution stats to graphviz?
There was a problem hiding this comment.
I don't think it's particularly difficult, but I'm not familiar with the graphviz format. It would just require some more time+effort to make it work properly
presto-main/src/main/java/com/facebook/presto/sql/planner/plan/ExplainAnalyzeNode.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/sql/planner/LogicalPlanner.java
Outdated
Show resolved
Hide resolved
| case GRAPHVIZ: | ||
| plan = graphvizDistributedPlan(queryInfo.getOutputStage().get().getSubStages().get(0), functionAndTypeManager, operatorContext.getSession()); |
There was a problem hiding this comment.
naive question - why is it hard to add execution stats to graphviz?
4774032 to
6d1b2fd
Compare
ddf57b1 to
741acd4
Compare
|
@feilong-liu @jaystarshot would you like to take a look at this? |
Will take a look and reply later today |
741acd4 to
382afa2
Compare
presto-main/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java
Outdated
Show resolved
Hide resolved
| @Test | ||
| public void testExplainAnalyzeFormatJson() | ||
| { | ||
| analyze("EXPLAIN ANALYZE (format JSON) SELECT * FROM t1"); |
There was a problem hiding this comment.
these just check that we don't fail. is there a way to test/see what the new output looks like?
There was a problem hiding this comment.
I added a deserialize method in the JsonRenderer class and an associated test inside of AbstractTestDistributedQueries
|
|
||
| private final Duration planNodeScheduledTime; | ||
| private final Duration planNodeCpuTime; | ||
| private final Duration planNodeBlockedWallTime; |
There was a problem hiding this comment.
why are these added here?
There was a problem hiding this comment.
The main driver behind this change is that we have an external tool that helps visualize some plans from the JSON output of the event listener. The event listener output is the actually the same output as what you get from an EXPLAIN ANALYZE. However, you only get execution statistics in the text output from the event listener, but not the JSON one. So, to augment the event listener's JSON plan output to be closer to the text version, I added some more statistics to this class.
This change adds two features: 1. Support for `format JSON` in EXPLAIN ANALYZE 2. Adds supoprt for a `stats` field in each plan node representation This allows the user to get a computer-friendly representation of the plan with the statistics. This can be useful for visualization
382afa2 to
72a7570
Compare
Description
This change adds two features:
format <X>in EXPLAIN ANALYZEstatsfield in each plan node representationThis allows the user to get a computer-friendly representation of the plan with the statistics. This can be useful for visualization or as input to other systems for plan node-level performance analysis.
Motivation and Context
Impact
PlanNodeStats.javaTest Plan
Contributor checklist
Release Notes