Closed cnuss closed 5 years ago
You can extract the number of stages from the plan
in the QueryMetadata
. Also, just curious, how are you going to use that information?
it looks like the plan is a generic String. What would I extract out of that for the number of stages?
I plan to use the number so I can properly tune max stages to a reasonable minimum above the default.
The plan should include information about the stages/fragments. Look for "Fragment N" in the plan.
Another way to get the number of stages is the cpuTimeDistribution
field in QueryStatistics
, which include cpu time distribution per stage. The number of stages should be cpuTimeDistribution.size()
.
Wow awesome, Thanks! I'll use that. And I'll close this issue.
Greetings!
In Presto 0.208,
query_max_stage_count
andquery.max-stage-count
was introduced.Now queries might fail with an error message of:
I use an event listener to capture Query Metadata using the Presto SPI to logs, however the number of stages (aka Fragments) don't appear to be set in the Query Statistics.
Could you add the number of stages/fragments as a metric in the Query Statistics of the Presto SPI?
Thanks!