maxburke commented on issue #15886: URL: https://github.com/apache/datafusion/issues/15886#issuecomment-2838965128
I have to say it was very much unexpected. As a sanity check, I compared to Postgres which does not remove the sorting operation. The Postgres docs say that CTEs "effectively serve as temporary tables that can be referenced from the FROM list" (https://www.postgresql.org/docs/current/sql-select.html), which I would read as to imply that they are not views. There is no documentation under the `ORDER BY` clause that states its applicability to CTEs (or views). I think optimizations that change the semantics of the query, legal transformation or not by the SQL standard, should be explicitly opt-in (and would still classify this issue as a bug) -- 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 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