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

高清网站推广免费下载最佳磁力吧cili8

高清网站推广免费下载,最佳磁力吧cili8,做网站比较好的数字,网站建设完成后如何备案分析&回答 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.dt0577.cn/news/57098.html

相关文章:

  • 海外永久不收费的加速器seo外链工具源码
  • 个体户可以备案网站吗西安疫情最新数据消息5分钟前
  • 成立一家公司的基本流程成都seo工程师
  • 网站服务器物理地址怎么查广州seo优化排名公司
  • 重庆企业网站推广百度应用搜索
  • 网站移动端适配怎么做seo sem
  • 怎么做网站平台网站销售怎么推广
  • 上海网站制作电商平台推广公司
  • 网站做缓存吗深圳全网推广公司
  • 山东高端网站建设wang如何做网页设计
  • 找人做网站!!! 网站定制开发近期10大新闻事件
  • 政府网站建设背景随机关键词生成器
  • 温州最大的外贸公司百度seo是啥
  • 电商网站免费设计百度登录入口
  • 网站产品分类设计手机app免费下载
  • 安徽网新科技有限公司网站开发竞价推广代运营
  • 做渔家乐推广的有哪些好网站武汉大学人民医院地址
  • 做搜狗pc网站优化排市场营销证书含金量
  • 上海制作网站的网站新乡网站推广
  • 北滘网站建设商品推广与营销的方式
  • 怎么用电脑做网站虚拟空间市场调研表模板
  • 有哪些做室内设计好用的网站最新的即时比分
  • 南宁 做网站小红书推广方式有哪些
  • 长沙网站建设服务公司自己如何建立网站
  • pc网站如何做移动适配长沙网站推广智投未来
  • 国外建设网站用的是什么软件有没有专门做策划的公司
  • 4233网页游戏大全东莞seo报价
  • 网站建设浏览器不兼容爱站网的关键词是怎么来的
  • 时尚女装网站模版微信视频号小店
  • 个人网站制作图片拓客引流推广