Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 10 additions & 2 deletions ballista/core/src/execution_plans/sort_shuffle/spill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,19 @@ impl SpillManager {
work_dir: &str,
job_id: &JobId,
stage_id: usize,
task_id: usize,
input_partition: usize,
schema: SchemaRef,
compression: Option<CompressionType>,
) -> Result<Self> {
// Spills live beside the task's data file, one directory per input
// partition, so a task owns exactly one directory under the stage and
// `cleanup` leaves only `data.arrow` and its index behind.
let mut spill_dir = PathBuf::from(work_dir);
spill_dir.push(job_id.as_str());
spill_dir.push(format!("{stage_id}"));
spill_dir.push(format!("{input_partition}"));
spill_dir.push("spill");
spill_dir.push(format!("{task_id}"));
spill_dir.push(format!("spill-{input_partition}"));

std::fs::create_dir_all(&spill_dir).map_err(BallistaError::IoError)?;

Expand Down Expand Up @@ -279,6 +283,7 @@ mod tests {
&"job1".into(),
1,
0,
0,
schema.clone(),
Some(CompressionType::LZ4_FRAME),
)?;
Expand Down Expand Up @@ -314,6 +319,7 @@ mod tests {
&"job1".into(),
1,
0,
0,
schema.clone(),
Some(CompressionType::LZ4_FRAME),
)?;
Expand Down Expand Up @@ -351,6 +357,7 @@ mod tests {
&"job1".into(),
1,
0,
0,
schema.clone(),
Some(CompressionType::LZ4_FRAME),
)?;
Expand Down Expand Up @@ -397,6 +404,7 @@ mod tests {
&"job1".into(),
1,
0,
0,
schema.clone(),
Some(CompressionType::LZ4_FRAME),
)?;
Expand Down
Loading