@@ -118,7 +118,7 @@ impl OnDemandRepartitionExec {
118
118
}
119
119
120
120
/// Get preserve_order flag of the RepartitionExecutor
121
- /// `true` means `SortPreservingRepartitionExec`, `false` means `RepartitionExec `
121
+ /// `true` means `SortPreservingRepartitionExec`, `false` means `OnDemandRepartitionExec `
122
122
pub fn preserve_order ( & self ) -> bool {
123
123
self . base . preserve_order
124
124
}
@@ -129,7 +129,7 @@ impl OnDemandRepartitionExec {
129
129
/// operator can take advantage of it.
130
130
///
131
131
/// If the input is not ordered, or has only one partition, this is a no op,
132
- /// and the node remains a `RepartitionExec `.
132
+ /// and the node remains a `OnDemandRepartitionExec `.
133
133
pub fn with_preserve_order ( mut self ) -> Self {
134
134
self . base = self . base . with_preserve_order ( ) ;
135
135
self
@@ -239,7 +239,6 @@ impl ExecutionPlan for OnDemandRepartitionExec {
239
239
240
240
let stream = futures:: stream:: once ( async move {
241
241
let num_input_partitions = input. output_partitioning ( ) . partition_count ( ) ;
242
-
243
242
let input_captured = Arc :: clone ( & input) ;
244
243
let metrics_captured = metrics. clone ( ) ;
245
244
let name_captured = name. clone ( ) ;
@@ -483,8 +482,8 @@ impl OnDemandRepartitionExec {
483
482
partition,
484
483
buffer_tx,
485
484
Arc :: clone ( & context) ,
486
- metrics. fetch_time ,
487
- metrics. send_buffer_time ,
485
+ metrics. fetch_time . clone ( ) ,
486
+ metrics. send_buffer_time . clone ( ) ,
488
487
) ) ;
489
488
490
489
// While there are still outputs to send to, keep pulling inputs
@@ -621,10 +620,11 @@ impl Stream for OnDemandPerPartitionStream {
621
620
cx : & mut Context < ' _ > ,
622
621
) -> Poll < Option < Self :: Item > > {
623
622
if !self . is_requested && !self . sender . is_closed ( ) {
624
- self . sender . try_send ( self . partition ) . map_err ( |_ | {
623
+ self . sender . send_blocking ( self . partition ) . map_err ( |e | {
625
624
internal_datafusion_err ! (
626
- "Error sending partition number to the receiver for partition {}" ,
627
- self . partition
625
+ "Error sending partition number to the receiver for partition {}: {}" ,
626
+ self . partition,
627
+ e
628
628
)
629
629
} ) ?;
630
630
self . is_requested = true ;
@@ -693,10 +693,11 @@ impl Stream for OnDemandRepartitionStream {
693
693
loop {
694
694
// Send partition number to input partitions
695
695
if !self . is_requested && !self . sender . is_closed ( ) {
696
- self . sender . try_send ( self . partition ) . map_err ( |_ | {
696
+ self . sender . send_blocking ( self . partition ) . map_err ( |e | {
697
697
internal_datafusion_err ! (
698
- "Error sending partition number to the receiver for partition {}" ,
699
- self . partition
698
+ "Error sending partition number to the receiver for partition {}: {}" ,
699
+ self . partition,
700
+ e
700
701
)
701
702
} ) ?;
702
703
self . is_requested = true ;
@@ -891,24 +892,32 @@ mod tests {
891
892
"| 1 |" ,
892
893
"| 1 |" ,
893
894
"| 1 |" ,
895
+ "| 1 |" ,
896
+ "| 2 |" ,
894
897
"| 2 |" ,
895
898
"| 2 |" ,
896
899
"| 2 |" ,
897
900
"| 3 |" ,
898
901
"| 3 |" ,
899
902
"| 3 |" ,
903
+ "| 3 |" ,
900
904
"| 4 |" ,
901
905
"| 4 |" ,
902
906
"| 4 |" ,
907
+ "| 4 |" ,
908
+ "| 5 |" ,
903
909
"| 5 |" ,
904
910
"| 5 |" ,
905
911
"| 5 |" ,
906
912
"| 6 |" ,
907
913
"| 6 |" ,
908
914
"| 6 |" ,
915
+ "| 6 |" ,
909
916
"| 7 |" ,
910
917
"| 7 |" ,
911
918
"| 7 |" ,
919
+ "| 7 |" ,
920
+ "| 8 |" ,
912
921
"| 8 |" ,
913
922
"| 8 |" ,
914
923
"| 8 |" ,
0 commit comments