Kristofferjoha commented on code in PR #27994:
URL: https://github.com/apache/datafusion/pull/27994#discussion_r4803065299
##########
datafusion/physical-plan/src/repartition/mod.rs:
##########
@@ -1327,6 +1354,60 @@ impl BatchPartitioner {
}
}
+ fn partition_take(
+ batch: &RecordBatch,
+ indices: &mut [Vec<u32>],
+ timer: &metrics::Time,
+ unshared_output: bool,
+ ) -> Result<Vec<Result<(usize, RecordBatch)>>> {
+ if unshared_output {
+ Self::partition_unshared_take(batch, indices, timer)
+ } else {
+ Self::partition_grouped_take(batch, indices, timer)
+ }
+ }
+
+ /// Like [`Self::partition_grouped_take`], but takes each partition
+ /// separately. See [`Self::with_unshared_output`].
+ fn partition_unshared_take(
+ batch: &RecordBatch,
+ indices: &mut [Vec<u32>],
+ timer: &metrics::Time,
+ ) -> Result<Vec<Result<(usize, RecordBatch)>>> {
+ let _timer = timer.timer();
+ let compact = batch
+ .schema()
+ .fields()
+ .iter()
+ .any(|field| may_compact(field.data_type()));
+ let mut batches = vec![];
+ for (partition, p_indices) in indices.iter_mut().enumerate() {
+ if p_indices.is_empty() {
+ continue;
Review Comment:
Done. When an output hangs up, the partitioner drops its rows before any
take, on both paths. Added a test.
##########
datafusion/physical-plan/src/repartition/mod.rs:
##########
Review Comment:
Done, same change as the other thread.
--
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]