Hive 将数据插入hive动态分区表或hdfs动态分区目录的优化 distribute by分区排序的应用

本文介绍了Hive在插入动态分区表时可能面临的资源消耗问题,并提出了通过设置`hive.exec.max.dynamic.partitions.pernode`、`hive.exec.max.dynamic.partitions`和`hive.exec.max.created.files`三个参数进行限制。当遇到太多动态分区导致错误时,可以通过在mapper中使用`distribute by`对分区列进行排序,减少分区数量。在实际工作中,如果情况不复杂,直接按日期和省份处理数据,不需要使用`distribute by`进行优化。
摘要由CSDN通过智能技术生成

将数据插入动态分区可能会导致短时间内(map任务)产生大量的分区(大于分区列的值去重后的数量),导致资源消耗过大,因此可以设置以下3个用于保护自己的参数。

  • Dynamic partition insert could potentially be a resource hog in that it could generate a large number of partitions in a short time. To get yourself buckled, we define three parameters:
    • hive.exec.max.dynamic.partitions.pernode (default value being 100) is the maximum dynamic partitions that can be created by each mapper or reducer. If one mapper or reducer created more than that the threshold, a fatal error will be raised from the mapper/reducer (through counter) and the whole job will be killed.   每个mapper或reducer可以创建的最大动态分区。
    • hive.exec.max.dynamic.partitions (default value being 1000) is the total number of dynamic partitions could be created by one DML. If each mapper/reducer did not exceed the limit but the total number of dyn
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值