在Hive中加入在MapReduce中触发哪种类型的JOIN? [英] JOIN in Hive triggers which type of JOIN in MapReduce?
问题描述
如果我在使用JOIN的 hive
中有一个查询,可以说一个 LEFT OUTER JOIN
或一个 INNER JOIN
在两个表 ON
任何列上,那么我怎么知道它在后面转换成哪种类型的JOIN -end MapReduce
(即Map-side JOIN或Reduce-side JOIN)?
谢谢。 使用解释
解释方法选择... 并检查计划。它解释了究竟地图和减少会做什么。在执行期间,您还可以检查作业跟踪器上的日志,并查看映射器或减速器进程正在执行的操作。
例如,下面的解释计划说它是地图边连接(注意地图连接算子在计划中):
阶段:阶段33
映射减少
映射运算符树:
TableScan
**别名:s **
filterExpr:(col is not null)(type:boolean)
统计数据:Num行数:85数据大小:78965基本统计数据:COMPLETE列统计数据:NONE
过滤运算符
谓词(col非空)(类型:布尔值)
统计数据:Num行数:22数据大小:20438基本统计数据:COMPLETE列统计数据:NONE
**地图加入运算符
条件地图:
内部加入0至1 **
If I have a query in hive
which employs JOIN, lets say a LEFT OUTER JOIN
or an INNER JOIN
on two tables ON
any column, then how do I know which type of JOIN is it getting converted into in the back-end MapReduce
(i.e. Map-side JOIN or Reduce-side JOIN) ?
Thanks.
Use explain select ...
and check the plan. It explains what exactly map and reduce will do. Also during execution you can check logs on job tracker and see what mapper or reducer processes are doing.
For example the following piece of explain plan says that it is map-side join (Note Map Join Operator in the plan):
Stage: Stage-33
Map Reduce
Map Operator Tree:
TableScan
**alias: s**
filterExpr: (col is not null) (type: boolean)
Statistics: Num rows: 85 Data size: 78965 Basic stats: COMPLETE Column stats: NONE
Filter Operator
predicate: (col is not null) (type: boolean)
Statistics: Num rows: 22 Data size: 20438 Basic stats: COMPLETE Column stats: NONE
**Map Join Operator
condition map:
Inner Join 0 to 1**
这篇关于在Hive中加入在MapReduce中触发哪种类型的JOIN?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!