@@ -45,14 +45,15 @@ use std::str::from_utf8_unchecked;
4545use std:: sync:: Arc ;
4646
4747use super :: {
48- RecordBatchOutput , trimmer, ColumnBuilder , Converter , FnFindLastLineBreak , FnLineBreakLen ,
48+ trimmer, ColumnBuilder , Converter , FnFindLastLineBreak , FnLineBreakLen , RecordBatchOutput ,
4949 Stats ,
5050} ;
5151use crate :: chunked;
52- use crate :: chunked:: recordbatch_output:: { IpcFileOut , output_factory , ParquetFileOut } ;
52+ use crate :: chunked:: recordbatch_output:: { output_factory , IpcFileOut , ParquetFileOut } ;
5353pub use crate :: cli:: Targets ;
5454use crate :: datatype:: DataType ;
5555use crate :: schema;
56+ use crate :: schema:: FixedSchema ;
5657use arrow:: datatypes:: { Field , Schema , SchemaRef } ;
5758use atomic_counter:: { AtomicCounter , ConsistentCounter } ;
5859use crossbeam:: atomic:: AtomicConsume ;
@@ -64,12 +65,11 @@ use rayon::join;
6465use std:: sync:: atomic:: { AtomicUsize , Ordering , ATOMIC_USIZE_INIT } ;
6566use std:: sync:: mpsc:: { sync_channel, Receiver , RecvError , SyncSender } ;
6667use std:: thread;
67- use tokio:: task:: JoinHandle ;
6868use std:: time:: { Duration , Instant } ;
6969use thread:: spawn;
7070use tokio:: runtime;
7171use tokio:: runtime:: Runtime ;
72- use crate :: schema :: FixedSchema ;
72+ use tokio :: task :: JoinHandle ;
7373//use ordered_channel::Sender;
7474//use crossbeam::channel::{Receiver, Sender};
7575
@@ -82,7 +82,7 @@ pub(crate) struct Slice2Arrow<'a> {
8282 pub ( crate ) masterbuilders : MasterBuilders ,
8383 pub ( crate ) consistent_counter : ConsistentCounter ,
8484 pub ( crate ) target : Targets ,
85- pub ( crate ) fixed_schema : FixedSchema
85+ pub ( crate ) fixed_schema : FixedSchema ,
8686}
8787
8888pub ( crate ) struct MasterBuilders {
@@ -245,13 +245,13 @@ impl<'a> Converter<'a> for Slice2Arrow<'a> {
245245 self . fixed_schema . clone ( ) ,
246246 self . masterbuilders . schema_factory ( ) ,
247247 self . masterbuilders . outfile . clone ( ) ,
248- rt
248+ rt,
249249 ) ;
250250 self . masterbuilders . sender = Some ( o. 0 . clone ( ) ) ;
251251 o
252252 }
253-
254- fn shutdown ( & mut self , rt : & runtime:: Runtime , jh : JoinHandle < Result < Stats > > ) {
253+
254+ fn shutdown ( & mut self , rt : & runtime:: Runtime , jh : JoinHandle < Result < Stats > > ) {
255255 let schema = Schema :: new ( vec ! [ Field :: new(
256256 "id" ,
257257 arrow:: datatypes:: DataType :: Int32 ,
@@ -261,8 +261,7 @@ impl<'a> Converter<'a> for Slice2Arrow<'a> {
261261 let emptyrb = arrow:: record_batch:: RecordBatch :: new_empty ( Arc :: new ( schema) ) ;
262262 let c = self . consistent_counter . get ( ) ;
263263 let _ = & self . masterbuilders . sender . clone ( ) . unwrap ( ) . send ( c, emptyrb) ;
264- rt. spawn_blocking ( || async { jh. await . unwrap ( ) } ) ;
265-
264+ rt. spawn_blocking ( || async { jh. await . unwrap ( ) } ) ;
266265 }
267266}
268267
0 commit comments