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 69b0648b12 Implement `tree` explain for `CsvSink` (#15204)
69b0648b12 is described below
commit 69b0648b12ce3dc6e4e31e13424ea96dbd2dc8fd
Author: irenjj <[email protected]>
AuthorDate: Thu Mar 13 21:35:58 2025 +0800
Implement `tree` explain for `CsvSink` (#15204)
---
datafusion/datasource-csv/src/file_format.rs | 6 ++++--
datafusion/sqllogictest/test_files/explain_tree.slt | 16 ++++++++++++++++
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/datafusion/datasource-csv/src/file_format.rs
b/datafusion/datasource-csv/src/file_format.rs
index cab561d163..cc1b63cfc9 100644
--- a/datafusion/datasource-csv/src/file_format.rs
+++ b/datafusion/datasource-csv/src/file_format.rs
@@ -666,8 +666,10 @@ impl DisplayAs for CsvSink {
write!(f, ")")
}
DisplayFormatType::TreeRender => {
- // TODO: collect info
- write!(f, "")
+ if !self.config.file_groups.is_empty() {
+ FileGroupDisplay(&self.config.file_groups).fmt_as(t, f)?;
+ }
+ Ok(())
}
}
}
diff --git a/datafusion/sqllogictest/test_files/explain_tree.slt
b/datafusion/sqllogictest/test_files/explain_tree.slt
index fbadc3a4f5..9e047133fc 100644
--- a/datafusion/sqllogictest/test_files/explain_tree.slt
+++ b/datafusion/sqllogictest/test_files/explain_tree.slt
@@ -1725,6 +1725,22 @@ physical_plan
09)│ rows: 1 │
10)└───────────────────────────┘
+query TT
+explain COPY (VALUES (1, 'foo', 1, '2023-01-01'), (2, 'bar', 2, '2023-01-02'),
(3, 'baz', 3, '2023-01-03'))
+TO 'test_files/scratch/explain_tree/2.csv';
+----
+physical_plan
+01)┌───────────────────────────┐
+02)│ DataSinkExec │
+03)└─────────────┬─────────────┘
+04)┌─────────────┴─────────────┐
+05)│ DataSourceExec │
+06)│ -------------------- │
+07)│ bytes: 2672 │
+08)│ format: memory │
+09)│ rows: 1 │
+10)└───────────────────────────┘
+
# Test explain tree rendering for CoalesceBatchesExec with limit
statement ok
CREATE TABLE IF NOT EXISTS t1 (a INT) AS
VALUES(1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]