dbt-utils
dbt-utils copied to clipboard
ENHANCEMENT: dbt-utils should not allow `GROUP BY` clauses that reference column aliases
offshoot of #744
There is usage of group_by that requires that the underlying data platform support using column aliases within a GROUP BY statement.
Trino, SQL Server, and others do not support this
Potential Solutions
Regardless of solution, we need standardization for when group_by is invoked.
- Use
CTEsto avoid column aliasing - introduce a dispatchable macro to allows adapter maintainers to opt-in or override the behavior in a single macro, rather than having to override entire macros
https://github.com/dbt-labs/dbt-utils/blob/6ba7b660b1d1b4e3b41cb0cf6c3c0e4a70ae54e4/macros/generic_tests/equal_rowcount.sql#L28-L38
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.
Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.