刷题刷出新高度,偷偷领先!偷偷领先!偷偷领先! 关注我们,悄悄成为最优秀的自己!
采用了BroadcastHashJoin广播小表,但必须满足两个条件:
MySQL 中一般使用 left outer join的左表必须是大表
left join是left outer join的缩写,所以作用是一样的。另外在SQL里没有区分大小写,也就是left join和LEFT JOIN都是可以的。
In Apache Hive, while the tables are large and all the tables used in the join are bucketed on the join columns we use Hive Bucket Map Join feature. Moreover, one table should have buckets in multiples of the number of buckets in another table in this type of join.
How Bucket Map Join Works
Let’s understand with an example. For suppose if one table has 2 buckets then the other table must have either 2 buckets or a multiple of 2 buckets (2, 4, 6, and so on). Further, since the preceding condition is satisfied then the joining can be done on the mapper side only.
Else a normal inner join is performed. Therefore, it implies that only the required buckets are fetched on the mapper side and not the complete table.
Hence, onto each mapper, only the matching buckets of all small tables are replicated. As a result of this, the efficiency of the query improves drastically. However, make sure data does not sort in a bucket map join.
Also, note that by default Hive does not support a bucket map join. So, we need to set the following property to true for the query to work as this join:
set hive.optimize.bucketmapjoin = true
本文链接:说说大表关联小表
版权声明:本站点所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明文章出处。让学习像火箭一样快速,微信扫码,获取考试解析、体验刷题服务,开启你的学习加速器!