kawadakk opened a new issue, #13558: URL: https://github.com/apache/datafusion/issues/13558
### Describe the bug Referencing a column from a certain form of `select` and `order by` clauses at the same time causes an error saying "projections require unique expression names". ### To Reproduce ``` > create table foo as values (1, 2), (3, 4), (5, 6); 0 row(s) fetched. Elapsed 0.002 seconds. > select cast(column1 as text) from foo order by column1; Error during planning: Projections require unique expression names but the expression "CAST(foo.column1 AS Utf8)" at position 0 and "foo.column1" at position 1 have the same name. Consider aliasing ("AS") one of them. ``` ### Expected behavior Successful query execution ### Additional context DataFusion v43.0.0 -- 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-unsubscr...@datafusion.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org