【发布时间】:2018-02-20 14:33:51
【问题描述】:
我有一个关于 hive mapjoin 的问题,我知道小表何时加入大表,使用 mapjoin 更好,但是当我得到这样的 sql 时
select a.col1,
a.col2,
a.col3,
/* there has many columns from table a, ignore..*/
b.col4,
b.col5,
b.col6
from a
inner join b
on (a.id = b.id)
where b.date = '2018-02-10'
and b.hour = '10';
提示:
表 b 是大表,行数:10000W+
表 a 是大表,行数:10000W+
带有谓词的表 b 仅返回 1000 行,
我认为这个 sql 将使用 mapjoin ,但执行计划是加入 reduce 端...
谁能告诉我为什么??
【问题讨论】:
-
连接类型(map 或其他)与查询返回的行数完全无关。表 A 中的给定 ID 可以有多行吗?
-
a.id 和 b.id 没有重复行,a:b 为 1:1
标签: join hive hive-configuration mapjoin