美文网首页
Hive的数据倾斜优化

Hive的数据倾斜优化

作者: 蓝Renly | 来源:发表于2019-04-21 15:40 被阅读0次
1.Skew Join

When working with data that has a highly uneven distribution, the data skew could happen in such a way that a small number of compute nodes must handle the bulk of the computation. The following setting informs Hive to optimize properly if data skew happens:

当处理的数据分布高度不平衡时,数据倾斜将以下面方式发生,少数的计算节点必须处理大部分的计算.如果数据发生倾斜,下面的设置方式能够使Hive适当的优化.

jdbc:hive2://> SET hive.optimize.skewjoin=true;
--If there is data skew in join, set it to true. Default is false.

--如果有数据早join时倾斜,将它设置为true.默认它是false.

jdbc:hive2://> SET hive.skewjoin.key=100000;
--This is the default value. If the number of key is bigger than this, the new keys will send to the other unused reducers.

--这是默认值.如果key的数量是超过这个,新的key将要被发送到已被使用的reducers.

Note
Skew data could happen on the GROUP BY data too. To optimize it, we need to do the
following settings to enable skew data optimization in the GROUP BY result:

注意

数据倾斜也在发生在GROUP BY数据.为了优化它,我们需要做下面的设置,使倾斜的数能够在GROUP BY结果中优化.

SET hive.groupby.skewindata=true;
Once configured, Hive will first trigger an additional MapReduce job whose map output will randomly distribute to the reducer to avoid data skew.

一旦配置,Hive将第一次触发一个额外的MapReduce job ,它的map输出将要随机的分布到reducer中来避免数据倾斜.

For more information about Hive join optimization, please refer to the Apache Hive wiki
available at
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+JoinOptimization and
https://cwiki.apache.org/confluence/display/Hive/Skewed+Join+Optimization.

相关文章

  • Hive优化

    Hive数据倾斜优化总结 Hive数据倾斜优化分为配置优化和SQL优化 优先原则: 数据不怕多,避免倾斜。 减少J...

  • hive 优化-1

    join优化-数据倾斜hive.optimize.skewjoin=true; 【TODO 细节】数据倾斜时启动两...

  • Hive优化实践1-数据倾斜及join无关的优化

    Hive SQL的各种优化方法基本 都和数据倾斜密切相关。 Hive的优化分为join相关的优化和join无关的优...

  • Hive优化

    Hive HQL优化 Hive优化目标在有限的资源下,执行效率更高 常见问题数据倾斜map数设置reduce数设置...

  • hive 数据倾斜优化

    在一个大表关联小表中遇到数据倾斜的问题,优化方法如下 mapjoin 类似写MR时,将小数据直接放入map缓存,通...

  • 坑合集

    Flume flume细节 Hive 数据倾斜Hive优化 Hive分区表新增字段为null的bug及解决方法 S...

  • Hive的数据倾斜优化

    1.Skew Join When working with data that has a highly unev...

  • Hive优化(五)-避免数据倾斜

    1.数据倾斜 什么是数据倾斜 在单个节点任务所处理的数据量远大于同类型任务所处理的数据量,导致该节点成为整个作业的...

  • Hive数仓-数据倾斜优化

    背景现象 数据倾斜的现象是,当提交运行一个程序时,这个程序的大多数的Task都已经运行结束了,只有某一个Task一...

  • Hive之COUNT DISTINCT优化

    COUNT(DISTINCT xxx) 在hive中很容易造成数据倾斜。针对这一情况,网上已有很多优化方法,这里不...

网友评论

      本文标题:Hive的数据倾斜优化

      本文链接:https://www.haomeiwen.com/subject/dgkjgqtx.html