alamb commented on PR #19412:
URL: https://github.com/apache/datafusion/pull/19412#issuecomment-3675652650

   I verified this query used to work in 50:
   ```shell
   DataFusion CLI v50.2.0
   > with t as (select 'foo' as x)
   select x, count(*) as "Count"
   from t
   group by x
   order by 2 desc;
   +-----+-------+
   | x   | Count |
   +-----+-------+
   | foo | 1     |
   +-----+-------+
   1 row(s) fetched.
   Elapsed 0.004 seconds.
   ```
   
   ```shell
   DataFusion CLI v51.0.0
   > with t as (select 'foo' as x)
   select x, count(*) as "Count"
   from t
   group by x
   order by 2 desc;
   Error during planning: Column in ORDER BY must be in GROUP BY or an 
aggregate function: While expanding wildcard, column "Count" must appear in the 
GROUP BY clause or must be part of an aggregate function, currently only "t.x, 
count(Int64(1)), count" appears in the SELECT clause satisfies this requirement
   ```


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