You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/10/18 10:58:05 UTC
[GitHub] [arrow-datafusion] alamb opened a new issue, #3873: Default physical planner generates empty relation for DROP TABLE, CREATE MEMORY TABLE, etc
alamb opened a new issue, #3873:
URL: https://github.com/apache/arrow-datafusion/issues/3873
**Describe the bug**
When we ran some unsupported DDL in our system
```sql
drop table foo
```
The output would be an empty table (rather than an unsupported error):
```
++
++
```
However, running `CREATE EXTERNAL TABLE` results in an error as expected.
**To Reproduce**
Try and run `drop table` (not through the datafusion CLI which handles these `LogicalPlan` variants specially)
**Expected behavior**
The physical planner should generate an error for DDL statements that have a `LogicalPlan` variant as it does for `CREATE EXTERNAL TABLE`
https://github.com/apache/arrow-datafusion/blob/b654fdea697b9aec1cb487e292dd288e5c9d09e3/datafusion/core/src/physical_plan/planner.rs#L1024-L1057
**Additional context**
We saw this in IOx https://github.com/influxdata/influxdb_iox/issues/5802 and worked around it in https://github.com/influxdata/influxdb_iox/pull/5876 by explicitly generating the errors
--
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.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] Kikkon commented on issue #3873: Default physical planner generates empty relation for DROP TABLE, CREATE MEMORY TABLE, etc
Posted by GitBox <gi...@apache.org>.
Kikkon commented on issue #3873:
URL: https://github.com/apache/arrow-datafusion/issues/3873#issuecomment-1288151129
@alamb If I understand correctly, just modify the return result of create_initial_plan, like this #3933.
--
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.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] alamb closed issue #3873: Default physical planner generates empty relation for DROP TABLE, CREATE MEMORY TABLE, etc
Posted by GitBox <gi...@apache.org>.
alamb closed issue #3873: Default physical planner generates empty relation for DROP TABLE, CREATE MEMORY TABLE, etc
URL: https://github.com/apache/arrow-datafusion/issues/3873
--
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.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] Kikkon commented on issue #3873: Default physical planner generates empty relation for DROP TABLE, CREATE MEMORY TABLE, etc
Posted by GitBox <gi...@apache.org>.
Kikkon commented on issue #3873:
URL: https://github.com/apache/arrow-datafusion/issues/3873#issuecomment-1285834215
🤣 I'm interested in this, you can assign it to me
--
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.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] alamb commented on issue #3873: Default physical planner generates empty relation for DROP TABLE, CREATE MEMORY TABLE, etc
Posted by GitBox <gi...@apache.org>.
alamb commented on issue #3873:
URL: https://github.com/apache/arrow-datafusion/issues/3873#issuecomment-1282203112
This is a good first issue as the needed pattern already exists and it is well localized.
--
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.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] retikulum commented on issue #3873: Default physical planner generates empty relation for DROP TABLE, CREATE MEMORY TABLE, etc
Posted by GitBox <gi...@apache.org>.
retikulum commented on issue #3873:
URL: https://github.com/apache/arrow-datafusion/issues/3873#issuecomment-1282875294
Hi. This seems interesting however when I try to produce the difference between `drop table foo` and `CREATE EXTERNAL TABLE`, they both output the same output. What did I do wrong? Output is the following:
```
++
++
```
My code for `CREATE EXTERNAL TABLE`:
```rust
use datafusion::error::Result;
use datafusion::prelude::*;
#[tokio::main]
async fn main() -> Result<()> {
// create local execution context
let ctx = SessionContext::new();
// execute the query
let df = ctx
.sql("CREATE EXTERNAL TABLE foo stored as parquet location \"test.parquet\"")
.await?;
// print the results
df.show().await?;
Ok(())
}
```
My code for `drop table test`:
```rust
use datafusion::error::Result;
use datafusion::prelude::*;
#[tokio::main]
async fn main() -> Result<()> {
// create local execution context
let ctx = SessionContext::new();
// register parquet file with the execution context
ctx.register_parquet(
"test",
"test.parquet",
ParquetReadOptions::default(),
)
.await?;
// execute the query
let df = ctx
.sql("drop table test")
.await?;
// print the results
df.show().await?;
Ok(())
}
```
--
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.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] alamb commented on issue #3873: Default physical planner generates empty relation for DROP TABLE, CREATE MEMORY TABLE, etc
Posted by GitBox <gi...@apache.org>.
alamb commented on issue #3873:
URL: https://github.com/apache/arrow-datafusion/issues/3873#issuecomment-1284574721
I think one difference may be that the SessionContext::sql has special handling for those statements (rather than running them through a logical plan): https://github.com/apache/arrow-datafusion/blob/b004ec7/datafusion/core/src/execution/context.rs#L286-L343
--
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.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org