Eric5553 opened a new pull request #27846: [SPARK-31079][SQL] Add RuleExecutor 
metrics in Explain Formatted
URL: https://github.com/apache/spark/pull/27846
 
 
   ### What changes were proposed in this pull request?
   RuleExecutor already support metering for analyzer/optimizer rules. By 
providing such information in Explain command, user can get better interactive 
user experience when debugging a specific query.
   This PR enhanced `EXPLAIN FORMATTED` to display RuleExecutor metrics. This 
can be easily done by calling the existing API `resetMetrics` and 
`dumpTimeSpent`, but there might be conflicts if user collect total metrics of 
a sql job which includes some explain commands. Thus I introduced 
`QueryExecutionMetrics`, as the snapshot of `QueryExecutionMetering`, to better 
support this feature.
   
   Information added to `Explain Formatted`
   ```
   === Metrics of Analyzer/Optimizer Rules ===
   Total number of runs: 554
   Total time: 0.107756568 seconds
   Total number of effective runs: 11
   Total time of effective runs: 0.047615486 seconds
   ```
   
   
   ### Why are the changes needed?
   Provide better query debugging user experience
   
   
   ### Does this PR introduce any user-facing change?
   Add  RuleExecutor metrics in Explain Formatted
   
   
   ### How was this patch tested?
   Update existing tests
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to