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
7 changes: 4 additions & 3 deletions datafusion/physical-plan/src/sorts/sort_preserving_merge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,16 @@ impl DisplayAs for SortPreservingMergeExec {
Ok(())
}
DisplayFormatType::TreeRender => {
if let Some(fetch) = self.fetch {
writeln!(f, "limit={fetch}")?;
};

for (i, e) in self.expr().iter().enumerate() {
e.fmt_sql(f)?;
if i != self.expr().len() - 1 {
write!(f, ", ")?;
}
}
if let Some(fetch) = self.fetch {
writeln!(f, "limit={fetch}")?;
};

Ok(())
}
Expand Down
48 changes: 48 additions & 0 deletions datafusion/sqllogictest/test_files/explain_tree.slt
Original file line number Diff line number Diff line change
Expand Up @@ -1685,6 +1685,54 @@ physical_plan



# query
query TT
explain SELECT * FROM data
WHERE date = '2006-01-02'
ORDER BY "ticker", "time"
LIMIT 5;
----
physical_plan
01)┌───────────────────────────┐
02)│ SortPreservingMergeExec │
03)│ -------------------- │
04)│ limit: 5 │
05)│ │
06)│ ticker ASC NULLS LAST, │
07)│ time ASC NULLS LAST │
08)└─────────────┬─────────────┘
09)┌─────────────┴─────────────┐
10)│ CoalesceBatchesExec │
11)│ -------------------- │
12)│ limit: 5 │
13)│ │
14)│ target_batch_size: │
15)│ 8192 │
16)└─────────────┬─────────────┘
17)┌─────────────┴─────────────┐
18)│ FilterExec │
19)│ -------------------- │
20)│ predicate: │
21)│ date = 2006-01-02 │
22)└─────────────┬─────────────┘
23)┌─────────────┴─────────────┐
24)│ RepartitionExec │
25)│ -------------------- │
26)│ partition_count(in->out): │
27)│ 1 -> 4 │
28)│ │
29)│ partitioning_scheme: │
30)│ RoundRobinBatch(4) │
31)└─────────────┬─────────────┘
32)┌─────────────┴─────────────┐
33)│ StreamingTableExec │
34)│ -------------------- │
35)│ infinite: true │
36)│ limit: None │
37)└───────────────────────────┘




# query
query TT
Expand Down