我试图总结Hive中2个内部查询的计数,但这会引发错误“UDAF计数尚未支持的位置”。任何建议都会很棒
SELECT sum(count(distinct session),count(distinct session1)) FROM (
select concat(high, low, visit_num) as session from tab1
union all
select concat(high, low, visit_num) as session1 from tab2)t;
答案 0 :(得分:3)
SELECT sum(cnt)
FROM
(
select count(distinct concat(high, low, visit_num)) as cnt from tab1
union all
select count(distinct concat(high, low, visit_num)) as cnt from tab2
) t