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
10 changes: 6 additions & 4 deletions datafusion/physical-plan/src/coalesce_partitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,12 @@ impl DisplayAs for CoalescePartitionsExec {
}
None => write!(f, "CoalescePartitionsExec"),
},
DisplayFormatType::TreeRender => {
// TODO: collect info
write!(f, "")
}
DisplayFormatType::TreeRender => match self.fetch {
Some(fetch) => {
write!(f, "limit: {fetch}")
}
None => write!(f, ""),
},
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion datafusion/sqllogictest/test_files/alias.slt
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ statement count 0
drop table t1;

statement count 0
drop table t2;
drop table t2;
77 changes: 69 additions & 8 deletions datafusion/sqllogictest/test_files/explain_tree.slt
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,26 @@ AS SELECT
FROM
hashjoin_datatype_table_t2_source

statement ok
CREATE UNBOUNDED EXTERNAL TABLE sink_table (
c1 VARCHAR NOT NULL,
c2 TINYINT NOT NULL,
c3 SMALLINT NOT NULL,
c4 SMALLINT NOT NULL,
c5 INTEGER NOT NULL,
c6 BIGINT NOT NULL,
c7 SMALLINT NOT NULL,
c8 INT NOT NULL,
c9 INT UNSIGNED NOT NULL,
c10 BIGINT UNSIGNED NOT NULL,
c11 FLOAT NOT NULL,
c12 DOUBLE NOT NULL,
c13 VARCHAR NOT NULL
)
STORED AS CSV
LOCATION '../../testing/data/csv/aggregate_test_100.csv'
OPTIONS ('format.has_header' 'true');

statement ok
CREATE TABLE limit_table AS
SELECT * FROM table1
Expand Down Expand Up @@ -257,14 +277,16 @@ 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)└───────────────────────────┘
03)│ -------------------- │
04)│ limit: 10 │
05)└─────────────┬─────────────┘
06)┌─────────────┴─────────────┐
07)│ DataSourceExec │
08)│ -------------------- │
09)│ bytes: 3120 │
10)│ format: memory │
11)│ rows: 2 │
12)└───────────────────────────┘

# 2 Joins
query TT
Expand Down Expand Up @@ -1990,3 +2012,42 @@ physical_plan
05)│ generate_series: start=1, │
06)│ end=100, batch_size=8192 │
07)└───────────────────────────┘

# Test explain tree for CoalescePartitionsExec
query TT
EXPLAIN SELECT c1, c2, c3 FROM sink_table WHERE c3 > 0 LIMIT 5;
----
physical_plan
01)┌───────────────────────────┐
02)│ CoalescePartitionsExec │
03)│ -------------------- │
04)│ limit: 5 │
05)└─────────────┬─────────────┘
06)┌─────────────┴─────────────┐
07)│ CoalesceBatchesExec │
08)│ -------------------- │
09)│ limit: 5 │
10)│ │
11)│ target_batch_size: │
12)│ 8192 │
13)└─────────────┬─────────────┘
14)┌─────────────┴─────────────┐
15)│ FilterExec │
16)│ -------------------- │
17)│ predicate: c3@2 > 0 │
18)└─────────────┬─────────────┘
19)┌─────────────┴─────────────┐
20)│ RepartitionExec │
21)│ -------------------- │
22)│ output_partition_count: │
23)│ 1 │
24)│ │
25)│ partitioning_scheme: │
26)│ RoundRobinBatch(4) │
27)└─────────────┬─────────────┘
28)┌─────────────┴─────────────┐
29)│ StreamingTableExec │
30)│ -------------------- │
31)│ infinite: true │
32)│ limit: None │
33)└───────────────────────────┘