Skip to content

Commit 21a9685

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 21a9685

File tree

2 files changed

+189
-186
lines changed

2 files changed

+189
-186
lines changed

src/stage.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use datafusion::error::Result;
55
use datafusion::execution::TaskContext;
66
use datafusion::physical_plan::display::DisplayableExecutionPlan;
77
use datafusion::physical_plan::{ExecutionPlan, ExecutionPlanProperties, displayable};
8-
use itertools::{Either, Itertools};
8+
use itertools::Either;
99
use std::collections::VecDeque;
1010
use std::sync::Arc;
1111
use url::Url;
@@ -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)