当前位置: 首页 > news >正文

智慧团建网站登录入口手机版上海外贸公司集中在哪些地方

智慧团建网站登录入口手机版,上海外贸公司集中在哪些地方,九福在线代理网页,免费的html模板下载分析&回答 Hive 大表和小表的关联 优先选择将小表放在内存中。小表不足以放到内存中,可以通过bucket-map-join(不清楚的话看底部文章)来实现,效果很明显。 两个表join的时候,其方法是两个join表在join key上都做hash bucket&#xff0c…

分析&回答

Hive 大表和小表的关联

  • 优先选择将小表放在内存中。
  • 小表不足以放到内存中,可以通过bucket-map-join(不清楚的话看底部文章)来实现,效果很明显。
    • 两个表join的时候,其方法是两个join表在join key上都做hash bucket,并且把你打算复制的那个(相对)小表的bucket数设置为大表的倍数。这样数据就会按照key join,做hash bucket。
    • 小表依然复制到所有节点,Map join的时候,小表的每一组bucket加载成hashtable,与对应的一个大表bucket做局部join,这样每次只需要加载部分hashtable就可以了。
    • set hive.optimize.bucketmapjoin = true;
    • 注意:如果表不是bucket的,则只是做普通join。

Spark 大表和小表的关联

采用了BroadcastHashJoin广播小表,但必须满足两个条件:

  1. 表的统计信息是否正确,也就是你要让执行计划知道你是小表,这一条我看基本上99%的文章都没有告诉你,这也是我折腾两天才发现的,我发现了就想告诉大家。我想起做MPP数据库跑批结束都会要求收集统计信息才想到的。
  2. 广播的表数据量小于spark.sql.autoBroadcastJoinThreshold值,这一条几乎所有文章都说了。 InMemoryTableScan , 除了占用内存外,效率是极高
    Spark 中 执行hive table scan操作,返回的MapPartitionsRDD对其重新定义mapPartition方法,将其行转列,并且最终cache到内存中。

MySQL 大表和小表的关联

MySQL 中一般使用 left outer join的左表必须是大表

反思&扩展

left join和left outer join的区别

left join是left outer join的缩写,所以作用是一样的。另外在SQL里没有区分大小写,也就是left join和LEFT JOIN都是可以的。

  • left join: 包含左表的所有行,对应的右表行可能为空。
  • right join: 包含右表的所有行,对应的左表行可能为空。
  • full join: 只包含左右表都匹配并且不为空的行。

Introduction to Bucket Map 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

喵呜面试助手:一站式解决面试问题,你可以搜索微信小程序 [喵呜面试助手] 或关注 [喵呜刷题] -> 面试助手 免费刷题。如有好的面试知识或技巧期待您的共享!

http://www.yayakq.cn/news/654085/

相关文章:

  • wordpress关键字过滤搜素引擎优化
  • 沧州南皮网站建设公司常州建设局下属网站
  • 电脑网站开发学习电子商城系统平台
  • 鄂尔多斯网站制作 建设推广微信网站建设计入什么科目
  • 网站建设费进什么科目评价模板
  • 天蝎网站推广优化mip改造wordpress
  • 购物网站多少钱青岛论坛
  • 做教育网站有什么好处重庆工商大学
  • php制作网站商城网站流程
  • 服装企业网站建设策划书没有任何收录的网站做SEM有用吗
  • 山东建设厅科技处网站提供衡水网站建设
  • 网站能实现什么功能上小学网站建设
  • 世纪兴网站建设徐州市城乡建设局官方网站
  • 网站建设网页模板下载网站seo关键词排名
  • 米课wordpress建站网站建设如何设置登录页面
  • 福建省建设工程资格中心网站wordpress 搬家 数据库
  • 网站内容有什么网站优化公司免费咨询
  • 网页设计与网站的关系青锐成长计划网站开发人员
  • 宁夏住房城乡建设厅网站杭州百度公司在哪里
  • 浙江舟山城乡建设网站查看网站建设时间
  • 工作设计室网站php网站设计流程
  • 网站定制兴田德润i在哪里哪个网站可以做360度评估
  • 电脑网站建设方案萍乡做网站哪家好
  • 移动端网站和微信网页设计wordpress 女性主题
  • 企业网站功能模块介绍诺邯郸网站建设
  • 成都全网营销型网站网站开发适合什么工作
  • 科迪兔网站建设铁路网站建设论文
  • 用易语言做钓鱼网站中国房地产排名100强
  • 没有专项备案的网站工商网官网
  • 贵阳做网站seo织梦企业模板去一品资源网