hive查询在0.13中挂起

t1rydlwq  于 2021-05-30  发布在  Hadoop
关注(0)|答案(1)|浏览(292)

我有12gb的表数据。
我的table是这样的:

userid name score
1      abc   1
1      pqr   1
2      mno   1
2      pqr   1
.
.
.
750000 mno   1

我的问题是:

select a.userid as user1,b.userid as user2, sum(a.score*b.score) as score,count(distinct a.name) as distinct_name from table a join table b on(a.name=b.name) limit 10;

它运行了数小时,但没有返回结果。我怎样才能解决这个问题?

nxowjjhe

nxowjjhe1#

试试这个,

select a.userid as user1,b.userid as user2, sum(a.score*b.score) as score,count(distinct a.name) as distinct_name 
from table a join table b on(a.name=b.name)
group by a.userid , b.userid
limit 10;

把你的表名换成表名;

相关问题