ion-elgreco commented on issue #5882:
URL: https://github.com/apache/arrow-rs/issues/5882#issuecomment-2288634562

   I got a bit confused  myself here, but @thomasfrederikhoeck you have issues 
during Optimize where the data is being read differently. @tustvold,  here it 
seems read a Parquet object within a tokio task, should this be rayon 
threadpool instead?
   
   ```rust
   let stream = match operations {
               OptimizeOperations::Compact(bins) => futures::stream::iter(bins)
                   .flat_map(|(_, (partition, bins))| {
                       futures::stream::iter(bins).map(move |bin| 
(partition.clone(), bin))
                   })
                   .map(|(partition, files)| {
                       debug!(
                           "merging a group of {} files in partition {:?}",
                           files.len(),
                           partition,
                       );
                       for file in files.iter() {
                           debug!("  file {}", file.location);
                       }
                       let object_store_ref = log_store.object_store();
                       let batch_stream = futures::stream::iter(files.clone())
                           .then(move |file| {
                               let object_store_ref = object_store_ref.clone();
                               async move {
                                   let file_reader = 
ParquetObjectReader::new(object_store_ref, file);
                                   
ParquetRecordBatchStreamBuilder::new(file_reader)
                                       .await?
                                       .build()
                               }
                           })
                           .try_flatten()
                           .boxed();
   
                       let rewrite_result = 
tokio::task::spawn(Self::rewrite_files(
                           self.task_parameters.clone(),
                           partition,
                           files,
                           log_store.object_store().clone(),
                           futures::future::ready(Ok(batch_stream)),
                       ));
                       util::flatten_join_error(rewrite_result)
                   })
                   .boxed(),
   ```


-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to