2.SemanticException 104:1 [Error 10213]: Grouping sets expression is not in GROUP BY key. Error encountered near token …
group by中字段与Grouping sets中字段,两者必须保持完全一致
3. FAILED: SemanticException [Error 10210]: Grouping sets aggregations (with rollups or cubes) are not allowed if aggregation function parameters overlap with the aggregation functions columns
该错误是指cube中的维度不能参数聚合函数的运算
例如 sum中拿cube维度做了判断
select a
,b
,c
,sum(d)-- 不报错,sum(casewhen a=1then d end)-- 会报错fromtablegroup a,b,c
grouping sets((a,b),(a,b,c))