alamb commented on a change in pull request #9605:
URL: https://github.com/apache/arrow/pull/9605#discussion_r584901754



##########
File path: rust/datafusion/src/physical_plan/repartition.rs
##########
@@ -48,9 +51,13 @@ pub struct RepartitionExec {
     input: Arc<dyn ExecutionPlan>,
     /// Partitioning scheme to use
     partitioning: Partitioning,
-    /// Channels for sending batches from input partitions to output partitions
-    /// there is one entry in this Vec for each output partition
-    channels: Arc<Mutex<Vec<(Sender<MaybeBatch>, Receiver<MaybeBatch>)>>>,
+    /// Channels for sending batches from input partitions to output 
partitions.
+    /// Key is the partition number
+    channels: Arc<

Review comment:
       Thanks @Dandandan 
   
   The use is here: 
https://github.com/apache/arrow/pull/9605/files#diff-b9b79e3b35bc8bfb43040ada3a4382bd0a0017ca1b1e8135be8fb310ff095674R229
 
   
   Basically this code sets up all input and outputs channels for all of the 
partitions and then hands out one receiver at a time in some arbitrary order 
(depending on the `partition` argument).
   
    `UnboundedReceiver` 
https://docs.rs/tokio/1.2.0/tokio/sync/mpsc/struct.UnboundedReceiver.html 
doesn't implement `Clone` (as it is multiple producer *single* consumer)
   
   I suspect with some more thought a different structure could be used, but I 
couldn't convince myself it was a valuable use of time. 




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to