andygrove commented on code in PR #141:
URL: https://github.com/apache/arrow-ballista/pull/141#discussion_r947393519


##########
ballista/rust/scheduler/src/state/execution_graph.rs:
##########
@@ -381,11 +381,21 @@ impl ExecutionPlanVisitor for ExecutionStageBuilder {
         } else if let Some(unresolved_shuffle) =
             plan.as_any().downcast_ref::<UnresolvedShuffleExec>()
         {
-            self.output_links
-                .insert(unresolved_shuffle.stage_id, self.current_stage_id);
+            if let Some(output_links) =
+                self.output_links.get_mut(&unresolved_shuffle.stage_id)
+            {
+                if !output_links.contains(&self.current_stage_id) {
+                    output_links.push(self.current_stage_id);
+                }
+            } else {
+                self.output_links
+                    .insert(unresolved_shuffle.stage_id, 
vec![self.current_stage_id]);
+            }
 
             if let Some(deps) = 
self.stage_dependencies.get_mut(&self.current_stage_id) {
-                deps.push(unresolved_shuffle.stage_id)
+                if !deps.contains(&unresolved_shuffle.stage_id) {

Review Comment:
   Same question here - would `HashSet` make more sense?



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

Reply via email to