mbutrovich commented on code in PR #1440: URL: https://github.com/apache/datafusion-comet/pull/1440#discussion_r1972566115
########## native/core/src/execution/shuffle/shuffle_writer.rs: ########## @@ -572,15 +567,12 @@ impl ShuffleRepartitioner { output_data.write_all(&output_batches[i])?; output_batches[i].clear(); - // append partition in each spills - for spill in &output_spills { - let length = spill.offsets[i + 1] - spill.offsets[i]; - if length > 0 { - let mut spill_file = - BufReader::new(File::open(spill.file.path()).map_err(Self::to_df_err)?); - spill_file.seek(SeekFrom::Start(spill.offsets[i]))?; - std::io::copy(&mut spill_file.take(length), &mut output_data) - .map_err(Self::to_df_err)?; + if let Some(spill_data) = self.buffered_partitions[i].spill_file.as_ref() { Review Comment: Makes sense. I misunderstood the granularity at which the spill file could be written to the output file. -- 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...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org