diff --git a/extensions/functions_aggregate_generic.yaml b/extensions/functions_aggregate_generic.yaml index 4db63ec32..9489d574b 100644 --- a/extensions/functions_aggregate_generic.yaml +++ b/extensions/functions_aggregate_generic.yaml @@ -40,3 +40,25 @@ aggregate_functions: decomposable: MANY intermediate: any1? return: any1? + - name: grouping + description: > + Indicates whether the column(s) in a GROUP BY list are aggregated or + not. This function can be used to distinguish between a NULL value in + the raw data vs the total across all values that are returned by ROLLUP, + CUBE or GROUPING SETS for a specific column. + + Returns an integer value which is unique for each combination of + grouping values. The return value can be interpreted as a bit vector + where bits in the binary representation of the integer correspond to each + grouping value. + + For a single grouping value, the result is 1 if the data is aggregated + across the specified column or 0 for not aggregated in the result set. + impls: + - args: + - value: any? + ordered: true + variadic: + min: 1 + nullability: DECLARED_OUTPUT + return: i64 diff --git a/tests/baseline.json b/tests/baseline.json index bde8b2093..4f2aa9ad6 100644 --- a/tests/baseline.json +++ b/tests/baseline.json @@ -10,7 +10,7 @@ }, "coverage": { "total_test_count": 1086, - "num_function_variants": 517, + "num_function_variants": 528, "num_covered_function_variants": 229 } }