alamb commented on a change in pull request #8083:
URL: https://github.com/apache/arrow/pull/8083#discussion_r480111822
##########
File path: rust/datafusion/src/execution/physical_plan/planner.rs
##########
@@ -278,6 +278,9 @@ impl DefaultPhysicalPlanner {
ctx_state.config.concurrency,
)?))
}
+ LogicalPlan::EmptyRelation { schema } => {
Review comment:
this is the actual fix
##########
File path: rust/datafusion/src/execution/physical_plan/planner.rs
##########
@@ -318,12 +330,9 @@ impl DefaultPhysicalPlanner {
format!("{:#?}", input),
));
}
- let schema_ref = Arc::new((**schema).clone());
+ let schema_ref = Arc::new(schema.as_ref().clone());
Review comment:
this `**` bothered me, so I switched to the different syntax. It has no
intended behavior change
##########
File path: rust/datafusion/src/execution/physical_plan/explain.rs
##########
@@ -44,7 +44,7 @@ pub struct ExplainExec {
}
impl ExplainExec {
- /// Create a new MergeExec
+ /// Create a new ExplainExec
Review comment:
I snuck this comment fix in -- I can remove it if people prefer.
##########
File path: rust/datafusion/tests/sql.rs
##########
@@ -517,9 +518,17 @@ fn register_aggregate_csv_by_sql(ctx: &mut
ExecutionContext) {
WITH HEADER ROW
LOCATION '{}/csv/aggregate_test_100.csv'
",
- testdata
- ))
- .unwrap();
+ testdata
+ ))
+ .expect("Creating dataframe for CREATE EXTERNAL TABLE");
+
+ // Mimic the CLI and execute the resulting plan -- even though it
+ // is effectively a no-op (returns zero rows)
+ let results = df.collect().expect("Executing CREATE EXTERNAL TABLE");
Review comment:
Prior to the code change, the tests now fail in the same way as reported in
ARROW-9889:
```
---- csv_query_create_external_table stdout ----
thread 'csv_query_create_external_table' panicked at 'Executing CREATE
EXTERNAL TABLE: General("Unsupported logical plan variant")',
datafusion/tests/sql.rs:526:19
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]