Hive 连接查询非常慢

Posted

技术标签:

【中文标题】Hive 连接查询非常慢【英文标题】:Hive join query very slow 【发布时间】:2014-05-05 16:10:11 【问题描述】:

我试图用 6 个减速器来减少他的以下查询,但我总是看到只有一个减速器启动。不知道为什么任务参数被忽略。请帮忙。 (我使用的是旧版本的 hive,因此不支持查询)

设置 mapred.reduce.tasks=6;

select concat(test1.col_0,test1.col_1) from test1 left outer join test2 where concat(test1.col_0,test1.col_1) = concat(test2.col_0,test2.col_1) and concat(test2.col_0,test2 .col_1) 为空;

【问题讨论】:

您可以尝试将第一个 where 子句转换为 ON 条件:select concat(test1.col_0,test1.col_1) from test1 left outer join test2 ON concat(test1.col_0,test1.col_1) = concat(test2.col_0,test2.col_1) 其中 concat(test2.col_0,test2.col_1) 为空; 【参考方案1】:

重新发布评论作为答案:

您可以尝试将第一个 where 子句转换为 ON 条件吗:

select concat(test1.col_0,test1.col_1) from test1 left outer join test2 ON concat(test1.col_0,test1.col_1) = concat(test2.col_0,test2.col_1) where concat(test2.col_0,test2.col_1) IS NULL;

【讨论】:

以上是关于Hive 连接查询非常慢的主要内容,如果未能解决你的问题,请参考以下文章