@@ -447,7 +447,7 @@ struct RepartitionStream {
447447 /// Number of input partitions that have finished sending batches to this output channel
448448 num_input_partitions_processed : usize ,
449449
450- /// Schema
450+ /// Schema wrapped by Arc
451451 schema : SchemaRef ,
452452
453453 /// channel containing the repartitioned batches
@@ -494,6 +494,7 @@ impl RecordBatchStream for RepartitionStream {
494494mod tests {
495495 use super :: * ;
496496 use crate :: from_slice:: FromSlice ;
497+ use crate :: test:: create_vec_batches;
497498 use crate :: {
498499 assert_batches_sorted_eq,
499500 physical_plan:: { collect, expressions:: col, memory:: MemoryExec } ,
@@ -508,7 +509,7 @@ mod tests {
508509 use arrow:: datatypes:: { DataType , Field , Schema } ;
509510 use arrow:: record_batch:: RecordBatch ;
510511 use arrow:: {
511- array:: { ArrayRef , StringArray , UInt32Array } ,
512+ array:: { ArrayRef , StringArray } ,
512513 error:: ArrowError ,
513514 } ;
514515 use futures:: FutureExt ;
@@ -601,23 +602,6 @@ mod tests {
601602 Arc :: new ( Schema :: new ( vec ! [ Field :: new( "c0" , DataType :: UInt32 , false ) ] ) )
602603 }
603604
604- fn create_vec_batches ( schema : & Arc < Schema > , n : usize ) -> Vec < RecordBatch > {
605- let batch = create_batch ( schema) ;
606- let mut vec = Vec :: with_capacity ( n) ;
607- for _ in 0 ..n {
608- vec. push ( batch. clone ( ) ) ;
609- }
610- vec
611- }
612-
613- fn create_batch ( schema : & Arc < Schema > ) -> RecordBatch {
614- RecordBatch :: try_new (
615- schema. clone ( ) ,
616- vec ! [ Arc :: new( UInt32Array :: from_slice( & [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ] ) ) ] ,
617- )
618- . unwrap ( )
619- }
620-
621605 async fn repartition (
622606 schema : & SchemaRef ,
623607 input_partitions : Vec < Vec < RecordBatch > > ,
0 commit comments