This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new e37d5801b4 Implement tree explain for `LocalLimitExec` (#15232)
e37d5801b4 is described below
commit e37d5801b45069374f65517c24956a6b435882fa
Author: Shruti Sharma <[email protected]>
AuthorDate: Sat Mar 15 01:48:42 2025 +0530
Implement tree explain for `LocalLimitExec` (#15232)
* feat: implement tree explain for locallimitexec
* remove hint
* Do not use VERBOSE
---------
Co-authored-by: Andrew Lamb <[email protected]>
---
datafusion/physical-plan/src/limit.rs | 3 +--
datafusion/sqllogictest/test_files/explain_tree.slt | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/datafusion/physical-plan/src/limit.rs
b/datafusion/physical-plan/src/limit.rs
index b9464e3a88..89cf47a6d6 100644
--- a/datafusion/physical-plan/src/limit.rs
+++ b/datafusion/physical-plan/src/limit.rs
@@ -268,8 +268,7 @@ impl DisplayAs for LocalLimitExec {
write!(f, "LocalLimitExec: fetch={}", self.fetch)
}
DisplayFormatType::TreeRender => {
- // TODO: collect info
- write!(f, "")
+ write!(f, "limit={}", self.fetch)
}
}
}
diff --git a/datafusion/sqllogictest/test_files/explain_tree.slt
b/datafusion/sqllogictest/test_files/explain_tree.slt
index 1a1b039658..83d2edee70 100644
--- a/datafusion/sqllogictest/test_files/explain_tree.slt
+++ b/datafusion/sqllogictest/test_files/explain_tree.slt
@@ -133,6 +133,11 @@ AS SELECT
FROM
hashjoin_datatype_table_t2_source
+statement ok
+CREATE TABLE limit_table AS
+SELECT * FROM table1
+UNION ALL SELECT * FROM table1
+
######## Begin Queries ########
# Filter
@@ -246,6 +251,21 @@ physical_plan
11)│ format: csv │
12)└───────────────────────────┘
+query TT
+explain SELECT * FROM limit_table LIMIT 10;
+----
+physical_plan
+01)┌───────────────────────────┐
+02)│ CoalescePartitionsExec │
+03)└─────────────┬─────────────┘
+04)┌─────────────┴─────────────┐
+05)│ DataSourceExec │
+06)│ -------------------- │
+07)│ bytes: 3120 │
+08)│ format: memory │
+09)│ rows: 2 │
+10)└───────────────────────────┘
+
# 2 Joins
query TT
explain SELECT table1.string_col, table2.date_col FROM table1 JOIN table2 ON
table1.int_col = table2.int_col;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]