我使用multiple union all,然后对每一列进行求和,但是这个查询就像永远运行一样。我有96gb的内存集群。请告诉我我应该做些什么来提高绩效。下面是我在hive中的查询。
total as
(
select * from
(
select * from table1
union all
select * from table2
union all
select * from table3
union all
select * from table4
union all
select * from table5
union all
select * from table6
union all
select * from table7
union all
select * from table8
union all
select * from table9
)p
)
Select * from
(
select
sum(col_1),
sum(col_2),
sum(col_3),
sum(col_4),
sum(col_5),
sum(col_6),
sum(col_7),
sum(col_8),
sum(col_9),
sum(col_10)
from total
)q;
暂无答案!
目前还没有任何答案,快来回答吧!