NoahKusaba commented on code in PR #2359:
URL: 
https://github.com/apache/datafusion-ballista/pull/2359#discussion_r3843584320


##########
ballista/core/src/execution_plans/sort_shuffle/writer.rs:
##########
@@ -1271,11 +1276,14 @@ fn compute_partition_indices(
         hash_buffer,
     )?;
 
-    let mut out: Vec<Vec<u32>> = (0..num_partitions).map(|_| 
Vec::new()).collect();
+    out.resize_with(num_partitions, Vec::new);
+    for rows in out.iter_mut() {
+        rows.clear();
+    }
     for (row, &h) in hash_buffer.iter().enumerate() {
         out[(h % num_partitions as u64) as usize].push(row as u32);

Review Comment:
   Actually I'll make a follow up PR today / tomorrow for that change, to make 
it easier for maintainers to review/approve. Thanks for the suggestion and an 
implementation to reference :)



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