select outer.col1,
outer.col2,
outer.col3,
outer.col4,
outer.col5,
outer.col6, count(*) as cnt
from (
select <some logic> as col1,
<some logic> as col2,
<some logic> as col3,
<some logic> as col4,
<some logic> as col5,
<some logic> as col6
from innerTable
)outer
group by outer.col1,
outer.col2,
outer.col3,
outer.col4,
outer.col5,
outer.col6
2条答案
按热度按时间cvxl0en21#
你可以用
shell sed
搜索newlines(\n)
并替换为comma(,)
.将逗号分隔的列名指定给
hive variable
,在配置单元查询中使用变量名。sed和set配置单元变量的引用
bvjveswy2#
你想过使用子查询甚至cte吗?也许这能帮你找到答案: