Skip to content

Commit e37d580

Browse files
shruti2522alamb
andauthored
Implement tree explain for LocalLimitExec (#15232)
* feat: implement tree explain for locallimitexec * remove hint * Do not use VERBOSE --------- Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
1 parent 824f108 commit e37d580

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

datafusion/physical-plan/src/limit.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,7 @@ impl DisplayAs for LocalLimitExec {
268268
write!(f, "LocalLimitExec: fetch={}", self.fetch)
269269
}
270270
DisplayFormatType::TreeRender => {
271-
// TODO: collect info
272-
write!(f, "")
271+
write!(f, "limit={}", self.fetch)
273272
}
274273
}
275274
}

datafusion/sqllogictest/test_files/explain_tree.slt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ AS SELECT
133133
FROM
134134
hashjoin_datatype_table_t2_source
135135

136+
statement ok
137+
CREATE TABLE limit_table AS
138+
SELECT * FROM table1
139+
UNION ALL SELECT * FROM table1
140+
136141
######## Begin Queries ########
137142

138143
# Filter
@@ -246,6 +251,21 @@ physical_plan
246251
11)│ format: csv │
247252
12)└───────────────────────────┘
248253

254+
query TT
255+
explain SELECT * FROM limit_table LIMIT 10;
256+
----
257+
physical_plan
258+
01)┌───────────────────────────┐
259+
02)│ CoalescePartitionsExec │
260+
03)└─────────────┬─────────────┘
261+
04)┌─────────────┴─────────────┐
262+
05)│ DataSourceExec │
263+
06)│ -------------------- │
264+
07)│ bytes: 3120 │
265+
08)│ format: memory │
266+
09)│ rows: 2 │
267+
10)└───────────────────────────┘
268+
249269
# 2 Joins
250270
query TT
251271
explain SELECT table1.string_col, table2.date_col FROM table1 JOIN table2 ON table1.int_col = table2.int_col;

0 commit comments

Comments
 (0)