@@ -91,7 +91,7 @@ pub(crate) fn output_factory(
9191 fixed_schema : FixedSchema ,
9292 schema : SchemaRef ,
9393 _outfile : PathBuf ,
94- rt : tokio:: runtime:: Runtime
94+ rt : & tokio:: runtime:: Runtime
9595) -> ( Sender < RecordBatch > , JoinHandle < Result < Stats > > ) {
9696 let mut pfo: Box < dyn RecordBatchOutput > =match target {
9797 Targets :: Parquet => {
@@ -173,7 +173,7 @@ impl DeltaOut {
173173
174174impl RecordBatchOutput for DeltaOut {
175175
176- fn setup ( & mut self , schema : SchemaRef , fixed_schema : FixedSchema , outfile : PathBuf , rt : tokio :: runtime :: Runtime ) -> ( Sender < RecordBatch > , JoinHandle < Result < Stats > > ) {
176+ fn setup ( & mut self , schema : SchemaRef , fixed_schema : FixedSchema , outfile : PathBuf , rt : & Runtime ) -> ( Sender < RecordBatch > , JoinHandle < Result < Stats > > ) {
177177
178178 let j: JoinHandle < Result < Stats > > =rt. spawn ( Self :: myDelta ( schema, fixed_schema, outfile) ) ;
179179
@@ -188,7 +188,7 @@ pub(crate) struct IcebergOut {
188188 pub ( crate ) sender : Option < Sender < RecordBatch > > ,
189189}
190190impl RecordBatchOutput for IcebergOut {
191- fn setup ( & mut self , schema : SchemaRef , fixed_schema : FixedSchema , outfile : PathBuf , rt : tokio :: runtime :: Runtime ) -> ( Sender < RecordBatch > , JoinHandle < Result < Stats > > ) {
191+ fn setup ( & mut self , schema : SchemaRef , fixed_schema : FixedSchema , outfile : PathBuf , rt : & Runtime ) -> ( Sender < RecordBatch > , JoinHandle < Result < Stats > > ) {
192192 todo ! ( )
193193 }
194194}
@@ -197,7 +197,7 @@ pub(crate) struct FlightOut {
197197}
198198
199199impl RecordBatchOutput for FlightOut {
200- fn setup ( & mut self , schema : SchemaRef , fixed_schema : FixedSchema , outfile : PathBuf , rt : tokio :: runtime :: Runtime ) -> ( Sender < RecordBatch > , JoinHandle < Result < Stats > > ) {
200+ fn setup ( & mut self , schema : SchemaRef , fixed_schema : FixedSchema , outfile : PathBuf , rt : & Runtime ) -> ( Sender < RecordBatch > , JoinHandle < Result < Stats > > ) {
201201 todo ! ( )
202202 }
203203}
@@ -207,7 +207,7 @@ pub(crate) struct ParquetFileOut {
207207 pub ( crate ) sender : Option < Sender < RecordBatch > > ,
208208}
209209impl ParquetFileOut {
210- pub ( crate ) async fn myParquet ( sender : Sender < RecordBatch > , mut receiver : Receiver < RecordBatch > , schema : SchemaRef , fixed_schema : FixedSchema , outfile : PathBuf ) ->( Result < Stats > ) {
210+ pub ( crate ) async fn myParquet ( mut receiver : Receiver < RecordBatch > , schema : SchemaRef , fixed_schema : FixedSchema , outfile : PathBuf ) ->( Result < Stats > ) {
211211// Self::deltasetup(fixed_schema).await.unwrap();
212212 let _out_file = fs:: OpenOptions :: new ( )
213213 . create ( true )
@@ -219,7 +219,7 @@ impl ParquetFileOut {
219219
220220 let mut writer: ArrowWriter < File > =
221221 ArrowWriter :: try_new ( _out_file, schema, Some ( props. clone ( ) ) ) . unwrap ( ) ;
222-
222+
223223 ' outer: loop {
224224 let mut message = receiver. recv ( ) ;
225225
@@ -251,14 +251,12 @@ impl ParquetFileOut {
251251 }
252252}
253253impl RecordBatchOutput for ParquetFileOut {
254- fn setup ( & mut self , schema : SchemaRef , fixed_schema : FixedSchema , outfile : PathBuf , rt : tokio :: runtime :: Runtime ) -> ( Sender < RecordBatch > , JoinHandle < Result < Stats > > ) {
254+ fn setup ( & mut self , schema : SchemaRef , fixed_schema : FixedSchema , outfile : PathBuf , rt : & Runtime ) -> ( Sender < RecordBatch > , JoinHandle < Result < Stats > > ) {
255255 let ( sender, mut receiver) = bounded :: < RecordBatch > ( 100 ) ;
256256
257257 self . sender = Some ( sender. clone ( ) ) ;
258258
259- let j: JoinHandle < Result < Stats > > =rt. spawn ( Self :: myParquet ( sender, receiver, schema, fixed_schema, outfile) ) ;
260-
261- // let j:JoinHandle<Result<Stats>>=rt.spawn(Self::myDelta(schema,fixed_schema,outfile));
259+ let j: JoinHandle < Result < Stats > > =rt. spawn ( Self :: myParquet ( receiver, schema, fixed_schema, outfile) ) ;
262260
263261 ( self . sender . as_mut ( ) . cloned ( ) . unwrap ( ) , j)
264262
@@ -271,7 +269,7 @@ pub struct IpcFileOut {
271269
272270
273271impl RecordBatchOutput for IpcFileOut {
274- fn setup ( & mut self , schema : SchemaRef , fixed_schema : FixedSchema , outfile : PathBuf , rt : tokio :: runtime :: Runtime ) -> ( Sender < RecordBatch > , JoinHandle < Result < Stats > > ) {
272+ fn setup ( & mut self , schema : SchemaRef , fixed_schema : FixedSchema , outfile : PathBuf , rt : & Runtime ) -> ( Sender < RecordBatch > , JoinHandle < Result < Stats > > ) {
275273 todo ! ( )
276274 }
277275}
0 commit comments