JOIN in Hive triggers which type of JOIN in MapReduce?

筅森魡賤 提交于 2019-12-20 05:53:07

问题


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.


回答1:


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**


来源:https://stackoverflow.com/questions/42970369/join-in-hive-triggers-which-type-of-join-in-mapreduce

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!