Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARROW-9889: [Rust][DataFusion] Implement physical plan for EmptyRelation #8083

Closed
wants to merge 1 commit into from

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Aug 31, 2020

This fixes an error I saw in the Datafusion CLI. Running CREATE EXTERNAL TABLE errors with "Unsupported logical plan variant"

Before this PR, you can't make an external table via the CLI:

>    create external table test(c1 boolean) stored as CSV location '/tmp/foo';
General("Unsupported logical plan variant")
>

After this PR:

> create external table test(c1 boolean) stored as CSV location '/tmp/foo';
0 rows in set. Query took 0 seconds.
>

Other changes:

  • Made the list of unsupported plan nodes explicit in the planer
  • Added a test for this behavior.

I think this error was introduced in #8027 which started (rightly) to treat all execution plans in a uniform way and do less special casing. FYI @andygrove

@@ -44,7 +44,7 @@ pub struct ExplainExec {
}

impl ExplainExec {
/// Create a new MergeExec
/// Create a new ExplainExec
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I snuck this comment fix in -- I can remove it if people prefer.

@@ -278,6 +278,9 @@ impl DefaultPhysicalPlanner {
ctx_state.config.concurrency,
)?))
}
LogicalPlan::EmptyRelation { schema } => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the actual fix

@@ -318,12 +330,9 @@ impl DefaultPhysicalPlanner {
format!("{:#?}", input),
));
}
let schema_ref = Arc::new((**schema).clone());
let schema_ref = Arc::new(schema.as_ref().clone());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this ** bothered me, so I switched to the different syntax. It has no intended behavior change

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to use idiomatic [language being written]. These changes are very welcoming from my side.


// 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");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@github-actions
Copy link

@alamb alamb force-pushed the alamb/ARROW-9889-create-table branch from f6bc35f to e2da41d Compare September 1, 2020 10:26
@alamb
Copy link
Contributor Author

alamb commented Sep 1, 2020

Rebased

@andygrove andygrove closed this in 956502c Sep 1, 2020
emkornfield pushed a commit to emkornfield/arrow that referenced this pull request Oct 16, 2020
This fixes an error I saw in the Datafusion CLI. Running `CREATE EXTERNAL TABLE` errors with `"Unsupported logical plan variant"`

Before this PR, you can't make an external table via the CLI:

```
>    create external table test(c1 boolean) stored as CSV location '/tmp/foo';
General("Unsupported logical plan variant")
>
```
After this PR:

```
> create external table test(c1 boolean) stored as CSV location '/tmp/foo';
0 rows in set. Query took 0 seconds.
>
```

Other changes:
* Made the list of unsupported plan nodes explicit in the planer
* Added a test for this behavior.

I think this error was introduced in apache#8027 which started (rightly) to treat all execution plans in a uniform way and do less special casing. FYI @andygrove

Closes apache#8083 from alamb/alamb/ARROW-9889-create-table

Authored-by: alamb <andrew@nerdnetworks.org>
Signed-off-by: Andy Grove <andygrove73@gmail.com>
@alamb alamb deleted the alamb/ARROW-9889-create-table branch October 26, 2020 20:04
GeorgeAp pushed a commit to sirensolutions/arrow that referenced this pull request Jun 7, 2021
This fixes an error I saw in the Datafusion CLI. Running `CREATE EXTERNAL TABLE` errors with `"Unsupported logical plan variant"`

Before this PR, you can't make an external table via the CLI:

```
>    create external table test(c1 boolean) stored as CSV location '/tmp/foo';
General("Unsupported logical plan variant")
>
```
After this PR:

```
> create external table test(c1 boolean) stored as CSV location '/tmp/foo';
0 rows in set. Query took 0 seconds.
>
```

Other changes:
* Made the list of unsupported plan nodes explicit in the planer
* Added a test for this behavior.

I think this error was introduced in apache#8027 which started (rightly) to treat all execution plans in a uniform way and do less special casing. FYI @andygrove

Closes apache#8083 from alamb/alamb/ARROW-9889-create-table

Authored-by: alamb <andrew@nerdnetworks.org>
Signed-off-by: Andy Grove <andygrove73@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants