adriangb commented on issue #15886:
URL: https://github.com/apache/datafusion/issues/15886#issuecomment-3690623911

   I found that this causes what I would call a bug with `Unparser`: 
https://github.com/apache/datafusion/pull/19483.
   
   Essentially the following query unparses into a subquery which then when 
re-parsed and optimized looses the order by, i.e. parsing/unparsing SQL changes 
the query semantics:
   
   ```sql
   SELECT
     col * 2 as x_bucket,
     count(*)
   FROM t1
   GROUP BY x_bucket
   ORDER BY x_bucket, count(*)
   ```
   
   We could try to fix it in the `Unparser` but the the point is that even our 
own codebase assumes the opposite behavior.


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to