hive rollup是CUBE的子集,以最左侧的维度为主(group by后的第一个元素),从该维度进行层级聚合;原文地址 https://www.cnblogs.com/qingyunzong/p/8798987.htmlSELECT month, day, COUNT(DISTINCT cookieid) AS uv, GROUPING__ID FROM cookie5 GROUP BY month,day WITH ROLLUP ORDER BY GROUPING__ID;