You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "drin (via GitHub)" <gi...@apache.org> on 2026/03/12 16:10:24 UTC

[I] Incorrectly parsed SQL query containing GROUP BY ALL and an alias in the projection [datafusion]

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: github-unsubscribe@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Incorrectly parsed SQL query containing GROUP BY ALL and an alias in the projection [datafusion]

Posted by "feichai0017 (via GitHub)" <gi...@apache.org>.
feichai0017 commented on issue #20909:
URL: https://github.com/apache/datafusion/issues/20909#issuecomment-4060460044

   I wanna take this


-- 
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-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Incorrectly parsed SQL query containing GROUP BY ALL and an alias in the projection [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #20909: Incorrectly parsed SQL query containing GROUP BY ALL and an alias in the projection
URL: https://github.com/apache/datafusion/issues/20909


-- 
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-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org