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
6 changes: 4 additions & 2 deletions datafusion/physical-plan/src/limit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,10 @@ impl DisplayAs for GlobalLimitExec {
)
}
DisplayFormatType::TreeRender => {
// TODO: collect info
write!(f, "")
if let Some(fetch) = self.fetch {
writeln!(f, "limit={}", fetch)?;
}
write!(f, "skip={}", self.skip)
}
}
}
Expand Down
21 changes: 21 additions & 0 deletions datafusion/sqllogictest/test_files/explain_tree.slt
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,27 @@ physical_plan
20)│ format: csv │
21)└───────────────────────────┘

# Limit
query TT
explain SELECT int_col FROM table1 LIMIT 3,2;
----
logical_plan
01)Limit: skip=3, fetch=2
02)--TableScan: table1 projection=[int_col], fetch=5
physical_plan
01)┌───────────────────────────┐
02)│ GlobalLimitExec │
03)│ -------------------- │
04)│ limit: 2 │
05)│ skip: 3 │
06)└─────────────┬─────────────┘
07)┌─────────────┴─────────────┐
08)│ DataSourceExec │
09)│ -------------------- │
10)│ files: 1 │
11)│ format: csv │
12)└───────────────────────────┘

# 2 Joins
query TT
explain SELECT table1.string_col, table2.date_col FROM table1 JOIN table2 ON table1.int_col = table2.int_col;
Expand Down