标签:count database union Hive 并行度 distinct Job table select
- 参数hive.exec.parallel可以控制一个sql中多个可并行执行的job的运行方式,当hive.exec.parallel为true的时候,同一个sql中可以并行执行的job会并发的执行;
- 而参数hive.exec.parallel.thread.number就是控制对于同一个sql来说同时可以运行的job的最大值,该参数默认为8.此时最大可以同时运行8个job.
- 案例:统计自助化投放宽表每个标签不为0的数据量
○ set hive.exec.parallel=true;
○ set hive.exec.parallel.thread.number=32;
○ sql:多段sql union all
select count(distinct column1) from ${database}.${table} union all
select count(distinct column2) from ${database}.${table} union all
select count(distinct column3) from ${database}.${table} union all
select count(distinct column4) from ${database}.${table} union all
select count(distinct column5) from ${database}.${table} union all
select count(distinct column6) from ${database}.${table} union all
......
○ 设置后并行度提到了32
14亿数据100多个select 优化前 执行三百多分钟,优化后30多分钟
标签:count,database,union,Hive,并行度,distinct,Job,table,select 来源: https://www.cnblogs.com/dakaizi88/p/15792352.html
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。