sandugood commented on code in PR #1778:
URL: 
https://github.com/apache/datafusion-ballista/pull/1778#discussion_r3309988277


##########
ballista/scheduler/src/api/handlers.rs:
##########
@@ -682,6 +687,85 @@ fn task_duration_percentiles(tasks: 
&[Option<TaskSummary>]) -> Option<Percentile
     })
 }
 
+fn format_stage_plan_with_metrics(
+    plan: &dyn ExecutionPlan,
+    stage_metrics: &[MetricsSet],
+    render_tree: bool,
+) -> String {
+    // If it is empty - fall back to render_tree
+    if stage_metrics.is_empty() {
+        return if render_tree {
+            displayable(plan).tree_render().to_string()
+        } else {
+            displayable(plan).indent(false).to_string()
+        };
+    }
+
+    let mut metric_idx = 0;
+    let result = format_node(plan, stage_metrics, &mut metric_idx, 0);
+
+    debug_assert_eq!(
+        metric_idx,
+        stage_metrics.len(),
+        "metric count mismatch: consumed {} but stage_metrics has {}",
+        metric_idx,
+        stage_metrics.len()
+    );
+
+    result
+}
+
+/// Formatting the node in DFS fashion
+/// It is constructed in the same way it is collected (using in-order 
traversal)

Review Comment:
   Yes, fixed. Thanks



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to