Jefffrey opened a new issue, #9327:
URL: https://github.com/apache/arrow-datafusion/issues/9327
### Describe the bug
Via SQL we disallow nested explains:
```rust
use datafusion::error::Result;
use datafusion::prelude::*;
#[tokio::main]
async fn main() -> Result<()> {
let ctx = SessionContext::new();
ctx.sql("explain explain select 1").await?.show().await?;
Ok(())
}
```
Will output:
```
Error: Plan("Nested EXPLAINs are not supported")
```
This is expected behaviour.
However, via the DataFrame API we can bypass this restriction.
### To Reproduce
```rust
use datafusion::error::Result;
use datafusion::prelude::*;
#[tokio::main]
async fn main() -> Result<()> {
let ctx = SessionContext::new();
ctx.sql("explain select 1")
.await?
.explain(false, false)? // NOTE: you can actually just keep adding
more explains here
.show()
.await?;
Ok(())
}
```
Will output:
```
+--------------+------------------------+
| plan_type | plan |
+--------------+------------------------+
| logical_plan | Explain |
| | Projection: Int64(1) |
| | EmptyRelation |
+--------------+------------------------+
```
### Expected behavior
DataFrame API version should throw an error like for SQL
### Additional context
_No response_
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]