nseekhao opened a new issue, #6058:
URL: https://github.com/apache/arrow-datafusion/issues/6058
### Describe the bug
The producer failed if the input query `INTERSECT`s `SELECT`s of the same
tables and columns multiple time.
### To Reproduce
```Rust
#[tokio::test]
async fn simple_intersect_table_reuse() -> Result<()> {
assert_expected_plan(
"SELECT COUNT(*) FROM (SELECT data.a FROM data INTERSECT SELECT
data.a FROM data);",
"Aggregate: groupBy=[[]], aggr=[[COUNT(UInt8(1))]]\
\n LeftSemi Join: data.a = data.a\
\n Aggregate: groupBy=[[data.a]], aggr=[[]]\
\n TableScan: data projection=[a]\
\n TableScan: data projection=[a]",
)
.await
}
```
### Expected behavior
```bash
---- tests::simple_intersect_table_reuse stdout ----
Error: SchemaError(DuplicateQualifiedField { qualifier: Bare { table: "data"
}, name: "a" })
```
### 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]