GROUP BY ROLLUP/CUBE/GROUPING SETS: full type-checking of null-eliminating grouping keys (Pending)¶
Attention
This behavior change is in the 2026_08 bundle.
For the current status of the bundle, refer to Bundle history.
When a key used in ROLLUP,
CUBE, or
GROUPING SETS appears inside a
null-eliminating expression such as IFNULL, the key can be NULL at grouping levels where it is
omitted. With the 2026_08 bundle enabled, Snowflake treats the expression as potentially nullable
during type-checking and continues checking later arguments in COALESCE.
- Before the change:
An
IFNULLexpression is ordinarily non-null, soCOALESCEcan treat later arguments as unreachable. Before this change, a grouping-set key inside thatIFNULLwas not treated as nullable for this check, even thoughROLLUPcan omit it. A parse or conversion error in a later argument could therefore be ignored, allowing the query to return incorrect or inconsistent results.For example, the invalid timestamp format in the following query could be skipped:
- After the change:
When a grouping set can omit a key inside
IFNULL, Snowflake treats the containing expression as potentially nullable during type-checking, even if it is non-null in practice.COALESCEtherefore continues checking later arguments. In this example, Snowflake reports the error in the invalidTO_TIMESTAMPformat instead of silently ignoring it and returning a result.
How to update your code¶
Review queries that use COALESCE or similar null-eliminating functions with ROLLUP, CUBE, or
GROUPING SETS. Correct invalid expressions in later arguments; after the 2026_08 bundle is enabled,
Snowflake reports errors in those arguments instead of potentially returning incorrect results.
Ref: 2435