Apache DataFusion SQL Query Engine
Add topk information into tree explain plans (#15547)
Lokeshf7b77a18db67
diff --git a/datafusion/physical-plan/src/sorts/sort.rs b/datafusion/physical-plan/src/sorts/sort.rsindex b04db06ea7..c0bae77613 100644--- a/datafusion/physical-plan/src/sorts/sort.rs+++ b/datafusion/physical-plan/src/sorts/sort.rs@@ -1112,7 +1112,10 @@ impl DisplayAs for SortExec {impl ExecutionPlan for SortExec {fn name(&self) -> &'static str {- "SortExec"+ match self.fetch {+ Some(_) => "SortExec(TopK)",+ None => "SortExec",+ }}fn as_any(&self) -> &dyn Any {diff --git a/datafusion/sqllogictest/test_files/explain_tree.slt b/datafusion/sqllogictest/test_files/explain_tree.sltindex 7a0e322eb8..8ad015e0b8 100644--- a/datafusion/sqllogictest/test_files/explain_tree.slt+++ b/datafusion/sqllogictest/test_files/explain_tree.slt@@ -889,7 +889,7 @@ explain SELECT * FROM table1 ORDER BY string_col LIMIT 1;----physical_plan01)┌───────────────────────────┐-02)│ SortExec │+02)│ SortExec(TopK) │03)│ -------------------- │04)│ limit: 1 │05)│ │