Skip to content

Commit

Permalink
Minor: show output ordering in MemoryExec
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Aug 1, 2023
1 parent e39b5ca commit ed9bba8
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions datafusion/core/src/physical_plan/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,23 @@ impl DisplayAs for MemoryExec {
) -> std::fmt::Result {
match t {
DisplayFormatType::Default | DisplayFormatType::Verbose => {
let partitions: Vec<_> =
let partition_sizes: Vec<_> =
self.partitions.iter().map(|b| b.len()).collect();

let output_ordering = self
.sort_information
.as_ref()
.map(|output_ordering| {
let order_strings: Vec<_> =
output_ordering.iter().map(|e| e.to_string()).collect();
format!(", output_ordering: {}", order_strings.join(","))
})
.unwrap_or_else(|| "".to_string());

write!(
f,
"MemoryExec: partitions={}, partition_sizes={:?}",
partitions.len(),
partitions
"MemoryExec: partitions={}, partition_sizes={partition_sizes:?}{output_ordering}",
partition_sizes.len(),
)
}
}
Expand Down

0 comments on commit ed9bba8

Please sign in to comment.