GROUP BY ALL with aliased aggregates causes physical plan error
warningconfigurationUpdated Mar 12, 2026(via Exa)
Technologies:
How to detect:
When a SQL query contains 'GROUP BY ALL' and an alias on a projected aggregate column (e.g., 'SELECT COUNT(*) AS c FROM t GROUP BY ALL'), the query fails during physical plan generation with an error indicating the physical plan does not support the logical expression for the aggregate function.
Recommended action:
Remove the alias from the aggregate column in the SELECT clause when using GROUP BY ALL. For example, change 'SELECT COUNT(*) AS c FROM t GROUP BY ALL' to 'SELECT COUNT(*) FROM t GROUP BY ALL'. Alternatively, wait for PR #20943 which addresses this bug. If the alias is required for application logic, apply it after retrieving results or use a subquery wrapper.