--1求橄、配置MR任務(wù)結(jié)束后進(jìn)行文件合并(合并小文件)
set hive.merge.mapfiles = true;
--在Map-only的任務(wù)結(jié)束時(shí)合并小文件
set hive.merge.mapredfiles = true;
--在Map-Reduce的任務(wù)結(jié)束時(shí)合并小文件
set hive.merge.size.per.tas = 512000000;
----合并文件的大小
set hive.merge.smallfiles.avgsize = 512000000;
--當(dāng)輸出文件的平均大小小于該值時(shí),啟動(dòng)一個(gè)獨(dú)立的map-reduce任務(wù)進(jìn)行文件merge
set hive.default.fileformat = Orc;
--ORC數(shù)據(jù)壓縮參數(shù)
set mapred.max.split.size=512000000;
--#每個(gè)Map最大輸入大小(目前集市層限制可能無(wú)效)
set mapred.min.split.size.per.node=512000000;
--#一個(gè)節(jié)點(diǎn)上split的至少的大小
set mapred.min.split.size.per.rack=512000000;
--#執(zhí)行Map前進(jìn)行小文件合并
set hive.hadoop.supports.splittable.combineinputformat = true;
--是否支持可切分的CombieInputFormat 工窍,true是支持
set mapreduce.input.fileinputformat.split.maxsize = 512000000;
--maxsize(切片最大值):參數(shù)如果調(diào)得比blocksize小多搀,則會(huì)讓切片變小聋亡,而且就等于配置的這個(gè)參數(shù)的值顽腾。
set mapreduce.input.fileinputformat.split.minsize.per =512000000;
--minsize (切片最小值):參數(shù)調(diào)的比blockSize大壁顶,則可以讓切片變得比blocksize還大珠洗。
set hive.exec.dynamic.partition = true;
---啟用動(dòng)態(tài)分區(qū)
set hive.exec.dynamic.partition.mode = nostrict;
---動(dòng)態(tài)分區(qū)類型
set hive.exec.max.dynamic.partitions.pernode = 1000;
--默認(rèn)值:100--;在每個(gè)執(zhí)行MR的節(jié)點(diǎn)上,最大可以創(chuàng)建多少個(gè)動(dòng)態(tài)分區(qū)若专。該參數(shù)需要根據(jù)實(shí)際的數(shù)據(jù)來(lái)設(shè)定许蓖。比如:源數(shù)據(jù)中包含了一年的數(shù)據(jù),即day字段有365個(gè)值调衰,那么該參數(shù)就需要設(shè)置成大于365膊爪,如果使用默認(rèn)值100,則會(huì)報(bào)錯(cuò)
set hive.exec.parallel = true;
--參數(shù)控制在同一個(gè)sql中的不同的job是否可以同時(shí)運(yùn)行,默認(rèn)為false.
set hive.exec.parallel.thread.number = 16;
--就是控制對(duì)于同一個(gè)sql來(lái)說(shuō)同時(shí)可以運(yùn)行的job的最大值,該參數(shù)默認(rèn)為8.此時(shí)最大可以同時(shí)運(yùn)行8個(gè)job.這里開(kāi)啟16個(gè)
set hive.new.job.grouping.set.cardinality = 5000;
--這條設(shè)置的意義在于告知解釋器嚎莉,group by之前米酬,每條數(shù)據(jù)復(fù)制量在5000份以內(nèi)。
常用的set頭如下:
SET hive.exec.dynamic.partition = true;
SET hive.exec.dynamic.partition.mode = nonstrict;
SET hive.exec.max.dynamic.partitions.pernode = 1000;
SET hive.exec.max.dynamic.partitions = 1000;
SET hive.exec.compress.output = true;
SET hive.exec.dynamic.partition.mode = nonstrict;
SET hive.exec.dynamic.partition = true;
SET hive.merge.mapfiles = true;
SET hive.merge.mapredfiles = true;
SET mapred.max.split.size=536870912;
SET mapred.min.split.size.per.node=536870912;
SET mapred.min.split.size.per.rack=536870912;
SET hive.input.format=[org.apache.hadoop.hive.ql.io](http://org.apache.hadoop.hive.ql.io/).CombineHiveInputFormat;
SET mapreduce.input.fileinputformat.split.minsize=536870912;
SET hive.map.aggr = true;
SET hive.groupby.mapaggr.checkinterval = 100000;
SET hive.auto.convert.join = true;
SET hive.default.fileformat = Orc;
SET hive.exec.parallel = true;
SET hive.exec.parallel.thread.number = 16;