drin opened a new issue, #20909:
URL: https://github.com/apache/datafusion/issues/20909

   ### Describe the bug
   
   When a query contains `GROUP BY ALL`, an alias on a projected column results 
in an error about an unsupported implementation. It can be seen in the logical 
plan that it was incorrectly parsed. This error does not happen when the alias 
is removed.
   
   ### To Reproduce
   
   ```python
   # /// script
   # dependencies = [
   #   "datafusion",
   # ]
   # ///
   
   from datafusion import SessionContext
   
   df_ctx = SessionContext()
   df_ctx.sql("CREATE TABLE t(first INT, second VARCHAR) AS VALUES (1, 'a'), 
(2, 'b'), (3, 'a')")
   
   good_df = df_ctx.sql('SELECT COUNT(*) FROM t GROUP BY ALL')
   print(good_df.logical_plan())
   print(good_df.collect())
   
   print('\n\n')
   
   bad_df = df_ctx.sql('SELECT COUNT(*) AS c FROM t GROUP BY ALL')
   print(bad_df.logical_plan())
   print(bad_df.collect())
   ```
   
   ### Expected behavior
   
   I expect `SELECT COUNT(*) FROM t GROUP BY ALL` and `SELECT COUNT(*) AS c 
FROM t GROUP BY ALL` to have the same behavior, and for both of them to succeed.
   
   ### 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]


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

Reply via email to