DDtKey opened a new issue, #4837:
URL: https://github.com/apache/arrow-datafusion/issues/4837
**Describe the bug**
`datafusion` panics for specific SQL-query:
```sql
(
SELECT * FROM table_1
EXCEPT
SELECT * FROM table_2
)
UNION ALL
(
SELECT * FROM table_2
EXCEPT
SELECT * FROM table_1
)
```
**To Reproduce**
Steps to reproduce the behavior:
```rust
let table_1_path = "...";
let table_2_path = "...";
let ctx = SessionContext::new();
ctx.register_csv("table_1", table_1_path, CsvReadOptions::default())
.await?;
ctx.register_csv("table_2", table_2_path, CsvReadOptions::default())
.await?;
let data_frame = ctx.sql("(SELECT * FROM table_1 EXCEPT SELECT * FROM
table_2) UNION ALL (SELECT * FROM table_2 EXCEPT SELECT * FROM
table_1)").await?;
data_frame.show().await?;
```
It will panic:
`thread 'main' panicked at 'index out of bounds: the len is 2 but the index
is 2'` (`len` & `index` depends on number of columns in file)
**Expected behavior**
It should works correctly or return error, but not to panic.
--
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]