Skip to content

Commit fe78b84

Browse files
display: use range to represent partitions in a task
This change makes the explain output more concise by changing the stage formatting from ``` Tasks: t0:[p0,p1,p2,p3,p4,p5] t1:[p0,p1,p2,p3,p4,p5] t2:[p0,p1,p2,p3,p4,p5] t3:[p0,p1,p2,p3,p4,p5] ``` to ``` Tasks: t0:[p0..p5] t1:[p0..p5] t2:[p0..p5] t3:[p0..p5] ``` Closes: #192
1 parent 63d3273 commit fe78b84

File tree

2 files changed

+188
-185
lines changed

2 files changed

+188
-185
lines changed

src/stage.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,12 @@ fn format_tasks_for_stage(n_tasks: usize, head: &Arc<dyn ExecutionPlan>) -> Stri
334334
let mut off = 0;
335335
for i in 0..n_tasks {
336336
result += &format!("t{i}:[");
337-
result += &(off..(off + input_partitions))
338-
.map(|v| format!("p{v}"))
339-
.join(",");
337+
let end = off + input_partitions - 1;
338+
if input_partitions == 1 {
339+
result += &format!("p{off}");
340+
} else {
341+
result += &format!("p{off}..p{end}");
342+
}
340343
result += "] ";
341344
off += if hash_shuffle { 0 } else { input_partitions }
342345
}

0 commit comments

Comments
 (0)