GROUPING_ID (Lakehouse v2)
Devolve uma máscara de bits correspondente ao agrupamento das colunas.
Sintaxe do Analyze
Seção intitulada “Sintaxe do Analyze”func.grouping_id(get_column(table, 'a'), get_column(table, 'b'))Exemplos do Analyze
Seção intitulada “Exemplos do Analyze”func.grouping_id(get_column(table, 'department'), get_column(table, 'year'))
┌───┐│ 0 │└───┘Sintaxe SQL
Seção intitulada “Sintaxe SQL”GROUPING_ID(<a>, <b>)Exemplos de SQL
Seção intitulada “Exemplos de SQL”SELECT department, year, GROUPING_ID(department, year), SUM(salary)FROM employees GROUP BY ROLLUP(department, year);
┌───┐│ 0 │└───┘