As it is known Redshift does not support ROLLUP, GROUPING SETS and CUBE aggregate functions. Do you know about any macros made by DBT community to programmatically create UNION ALL expressions to mimic GROUPING SETS behaviour?
I had never heard of GROUPING SETS, but I just read up about them here: SQL GROUPING SETS - Generate Multiple Grouping Sets
This is very cool! I would love to support something like it in dbt utils - could you open an issue? Issues · dbt-labs/dbt-utils · GitHub
It’d be sort of like how there is native width_bucket on Snowflake but not others, so we have made an equivalent.
It looks like BQ at least doesn’t support it either: Google BigQuery Grouping Sets Alternative and Example - DWgeek.com