Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions native/core/src/execution/shuffle/shuffle_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -779,9 +779,10 @@ impl ShufflePartitioner for MultiPartitionShuffleRepartitioner {

// if we wrote a spill file for this partition then copy the
// contents into the shuffle file
if let Some(spill_data) = self.partition_writers[i].spill_file.as_ref() {
let mut spill_file =
BufReader::new(File::open(spill_data.temp_file.path()).map_err(to_df_err)?);
if let Some(spill_data) = self.partition_writers[i].spill_file.as_mut() {
let file = &mut spill_data.file;
file.seek(SeekFrom::Start(0))?;
let mut spill_file = BufReader::new(file);
let mut write_timer = self.metrics.write_time.timer();
std::io::copy(&mut spill_file, &mut output_data).map_err(to_df_err)?;
write_timer.stop();
Expand Down Expand Up @@ -1113,6 +1114,7 @@ struct PartitionWriter {
}

struct SpillFile {
#[allow(dead_code)]
temp_file: RefCountedTempFile,
file: File,
}
Expand Down Expand Up @@ -1168,6 +1170,7 @@ impl PartitionWriter {
let spill_data = OpenOptions::new()
.write(true)
.create(true)
.read(true)
.truncate(true)
.open(spill_file.path())
.map_err(|e| {
Expand Down
Loading