Skip to content

Commit f7b77a1

Browse files
authored
Add topk information into tree explain plans (#15547)
* Add topk information into tree explain plans * change display rule for topk label
1 parent 0b061be commit f7b77a1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

datafusion/physical-plan/src/sorts/sort.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,10 @@ impl DisplayAs for SortExec {
11121112

11131113
impl ExecutionPlan for SortExec {
11141114
fn name(&self) -> &'static str {
1115-
"SortExec"
1115+
match self.fetch {
1116+
Some(_) => "SortExec(TopK)",
1117+
None => "SortExec",
1118+
}
11161119
}
11171120

11181121
fn as_any(&self) -> &dyn Any {

datafusion/sqllogictest/test_files/explain_tree.slt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ explain SELECT * FROM table1 ORDER BY string_col LIMIT 1;
889889
----
890890
physical_plan
891891
01)┌───────────────────────────┐
892-
02)│ SortExec
892+
02)│ SortExec(TopK)
893893
03)│ -------------------- │
894894
04)│ limit: 1 │
895895
05)│ │

0 commit comments

Comments
 (0)