Hive(13):Hive與MR相關引數
阿新 • • 發佈:2018-11-12
一、實現功能
如果核心數比較少,記憶體比較多,則可以每個reduce多設定記憶體,使一個核心處理能力增大;
如果核心數充足,則記憶體設定可以比較少,進而使多個核心處理任務,增加處理速度。
二、配置
1.In order to change the average load for a reducer (in bytes):
每個reduce能夠處理的資料量,位元組,預設是1個G
set hive.exec.reducers.bytes.per.reducer=<number>; 例如 set hive.exec.reducers.bytes.per.reducer=1000000000;
2.In order to limit the maximum number of reducers:
設定最大執行的reduce個數,預設999個
set hive.exec.reducers.max=<number>
3.In order to set a constant number of reducers:
設定實際執行reduce的個數(預設值是1,但是在配置檔案裡面是看不到的)
set mapreduce.job.reduces=<number>
4.hive-site.xml的配置:
<property> <name>hive.exec.reducers.bytes.per.reducer</name> <value>1000000000</value> <description>size per reducer.The default is 1G, i.e if the input size is 10G, it will use 10 reducers.</description> </property> <property> <name>hive.exec.reducers.max</name> <value>999</value> <description>max number of reducers will be used. If the one specified in the configuration parameter mapred.reduce.tasks is negative, Hive will use this one as the max number of reducers when automatically determine number of reducers.</description> </property>