hive并行执行job
2012-12-28 17:21
423 查看
用过oracle rac的应该都知道parallel的用途。
并行执行的确可以大的加快任务的执行速率,但不会减少其占用的资源。
在hive中也有并行执行的选项。
set hive.exec.parallel=true; //打开任务并行执行
set hive.exec.parallel.thread.number=16; //同一个sql允许最大并行度,默认为8。
对于同一个SQL产生的JOB,如果不存在依赖的情况下,将会并行启动JOB,
比如:
Sql代码
from (
select phone,to_phone, substr(to_phone,-1) as key
from youni_contact4_lxw
where youni_id='1'
and length(to_phone) = 11
and substr(to_phone,1,2) IN ('13','14','15','18')
group by phone,to_phone, substr(to_phone,-1)
) t
insert overwrite table youni_contact41_lxw partition(pt='0')
select phone,to_phone where key='0'
insert overwrite table youni_contact41_lxw partition(pt='1')
select phone,to_phone where key='1'
insert overwrite table youni_contact41_lxw partition(pt='2')
select phone,to_phone where key='2'
insert overwrite table youni_contact41_lxw partition(pt='3')
select phone,to_phone where key='3'
insert overwrite table youni_contact41_lxw partition(pt='4')
select phone,to_phone where key='4'
insert overwrite table youni_contact41_lxw partition(pt='5')
select phone,to_phone where key='5'
insert overwrite table youni_contact41_lxw partition(pt='6')
select phone,to_phone where key='6'
insert overwrite table youni_contact41_lxw partition(pt='7')
select phone,to_phone where key='7'
insert overwrite table youni_contact41_lxw partition(pt='8')
select phone,to_phone where key='8'
insert overwrite table youni_contact41_lxw partition(pt='9')
select phone,to_phone where key='9';
该SQL产生11个job,第一个job为生成临时表的job,后续job都依赖它,这时不会有并行启动,
第一个job完成后,后续的job都会并行启动。
运行时间比较:
不启用并行:35分钟
启用8个并行:10分钟
启用16个并行:6分钟
当然,得是在系统资源比较空闲的时候才有优势,否则,没资源,并行也起不来。
http://superlxw1234.iteye.com/blog/1703713
并行执行的确可以大的加快任务的执行速率,但不会减少其占用的资源。
在hive中也有并行执行的选项。
set hive.exec.parallel=true; //打开任务并行执行
set hive.exec.parallel.thread.number=16; //同一个sql允许最大并行度,默认为8。
对于同一个SQL产生的JOB,如果不存在依赖的情况下,将会并行启动JOB,
比如:
Sql代码
from (
select phone,to_phone, substr(to_phone,-1) as key
from youni_contact4_lxw
where youni_id='1'
and length(to_phone) = 11
and substr(to_phone,1,2) IN ('13','14','15','18')
group by phone,to_phone, substr(to_phone,-1)
) t
insert overwrite table youni_contact41_lxw partition(pt='0')
select phone,to_phone where key='0'
insert overwrite table youni_contact41_lxw partition(pt='1')
select phone,to_phone where key='1'
insert overwrite table youni_contact41_lxw partition(pt='2')
select phone,to_phone where key='2'
insert overwrite table youni_contact41_lxw partition(pt='3')
select phone,to_phone where key='3'
insert overwrite table youni_contact41_lxw partition(pt='4')
select phone,to_phone where key='4'
insert overwrite table youni_contact41_lxw partition(pt='5')
select phone,to_phone where key='5'
insert overwrite table youni_contact41_lxw partition(pt='6')
select phone,to_phone where key='6'
insert overwrite table youni_contact41_lxw partition(pt='7')
select phone,to_phone where key='7'
insert overwrite table youni_contact41_lxw partition(pt='8')
select phone,to_phone where key='8'
insert overwrite table youni_contact41_lxw partition(pt='9')
select phone,to_phone where key='9';
该SQL产生11个job,第一个job为生成临时表的job,后续job都依赖它,这时不会有并行启动,
第一个job完成后,后续的job都会并行启动。
运行时间比较:
不启用并行:35分钟
启用8个并行:10分钟
启用16个并行:6分钟
当然,得是在系统资源比较空闲的时候才有优势,否则,没资源,并行也起不来。
http://superlxw1234.iteye.com/blog/1703713
相关文章推荐
- hive并行执行job
- hive并行执行job
- hive并行执行job
- PowerShell中Job相关命令及并行执行任务详解
- 大数据Spark “蘑菇云”行动第94课:Hive性能调优之Mapper和Reducer设置、队列设置和并行执行、JVM重用和动态分区、Join调优
- Hive优化--并行执行
- hive优化之并行执行任务
- [置顶] 第94课:Hive性能调优之Mapper和Reducer设置、队列设置和并行执行、JVM重用和动态分区、Join调优等
- 并行执行 Job - 每天5分钟玩转 Docker 容器技术(134)
- Hive执行job时return code 2排查
- [Hive]Hive调优:让任务并行执行
- 利用job并行执行Oracle存储过程
- hive执行job的时候报错:hadoop.hive.ql.exec.tez.TezTask
- 并行执行 Job - 每天5分钟玩转 Docker 容器技术(134)
- hive-调优笔记:JVM重用,并行执行、调整reducer个数的用处
- [Hive]Hive调优:让任务并行执行
- 并行执行 Job - 每天5分钟玩转 Docker 容器技术(134)
- kttle在job中并行执行ktr和kjb
- 并行执行 Job - 每天5分钟玩转 Docker 容器技术(134)
- hive 实现job并发执行