berkaysynnada opened a new issue, #6543:
URL: https://github.com/apache/arrow-datafusion/issues/6543
### Describe the bug
When we give the same aliases for multiple columns (`SELECT ts as c1,
inc_col as c1 FROM annotated_data_infinite`), builder gives such an error:
`Plan("Projections require unique expression names but the expression
\"annotated_data_infinite.ts AS c1\" at position 0 and
\"annotated_data_infinite.inc_col AS c1\" at position 1 have the same name.
Consider aliasing (\"AS\") one of them.")`
Postgre can handle it and gives result with two columns having the same
name. I don't know this is an intentional behaviour in Datafusion or a bug, but
I would like to open an issue.
### To Reproduce
```
ctx.sql(
"CREATE EXTERNAL TABLE annotated_data_infinite (
ts INTEGER,
inc_col INTEGER,
desc_col INTEGER,
)
STORED AS CSV
WITH HEADER ROW
WITH ORDER (ts ASC)
LOCATION
'/Users/berkaysahin/Desktop/arrow-datafusion/datafusion/core/tests/data/window_1.csv'",
)
.await?;
let sql = "SELECT ts as c1, inc_col as c1 FROM
annotated_data_infinite";
let dataframe = ctx.sql(sql).await.expect(&msg);
```
### Expected behavior
_No response_
### 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]