andygrove commented on code in PR #1440: URL: https://github.com/apache/datafusion-comet/pull/1440#discussion_r1972551155
########## 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: I added some comments and also removed the check for length > 0 since that was redundant (we only create the spill file if we have data to spill) -- 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