-
Notifications
You must be signed in to change notification settings - Fork 198
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
Add REST API to generate DOT graph for individual query stage #310
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/// Generate a dot graph for the specified job id and return as plain text | ||
pub(crate) async fn get_job_dot_graph<T: AsLogicalPlan, U: AsExecutionPlan>( | ||
data_server: SchedulerServer<T, U>, | ||
job_id: String, | ||
) -> Result<String, Rejection> { | ||
let graph = data_server | ||
let maybe_graph = data_server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I liked just "graph" 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refactored this to avoid the need for this intermediate variable
/// Get the name of the variant | ||
pub(crate) fn name(&self) -> &str { | ||
match self { | ||
ExecutionStage::UnResolved(_) => "Unresolved", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this simply be the impl Display
of ExecutionStage
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed this to variant_name()
to make it clear that this is just returning the variant name, not the full details of the stage
)?); | ||
} | ||
} | ||
writeln!(&mut dot, "\t\tlabel = \"Stage {} [{}]\";", id, stage.name())?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice refactor 😃
@avantgardnerio I pushed changes to address feeback and also changed job name from |
Which issue does this PR close?
Closes N/A
Rationale for this change
For large and complex queries, I would like to be able to view the query plan for an individual query stage.
What changes are included in this PR?
Are there any user-facing changes?