2
我有一個用例,我想在幾個列上分組,並在特定列上聚合group by
子句中的列的子集。Hive中的分析查詢限制
示例方案
表結構:
(id int, category1 string, category2 string, category3 string, value int)
欲執行以下查詢:
select sum(value) over (partition by category1) as c1_sum, sum(value) over (partition by category2) as c2_sum, sum(value) over (partition by category3) as c3_sum from <table_name> group by category_1, category2, category3;
然而蜂房抱怨列value
不是的一個部分group by
條款。
是否有不同的方式來實現蜂巢?
任何建議將不勝感激。謝謝!