您好,登錄后才能下訂單哦!
小編給大家分享一下hive中如何計(jì)算reduce的個(gè)數(shù),相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!
hive> select count(1) from serde_regex; Automatically selecting local only mode for query Query ID = hadoop_20160125101917_ab5615a4-e6f1-47e3-9e97-6795c3268cea Total jobs = 1 Launching Job 1 out of 1 Number of reduce tasks determined at compile time: 1 In order to change the average load for a reducer (in bytes): set hive.exec.reducers.bytes.per.reducer=<number> In order to limit the maximum number of reducers: set hive.exec.reducers.max=<number> In order to set a constant number of reducers: set mapreduce.job.reduces=<number>
計(jì)算的公式: reduce個(gè)數(shù) = InputFileSize / bytes per reducer
有三個(gè)參數(shù)
hive.exec.reducers.bytes.per.reducer 控制一個(gè)reducer能處理多少input。 default 256M
hive> set hive.exec.reducers.bytes.per.reducer; hive.exec.reducers.bytes.per.reducer=256000000
hive.exec.reducers.max 控制最大的reducer數(shù)量。如果input / bytes per reduce > max 會(huì)啟動(dòng)該參數(shù)設(shè)定的值,
hive> set hive.exec.reducers.max; hive.exec.reducers.max=1009
mapreduce.reduce.tasks 這個(gè)參數(shù)指定了,那么不會(huì)進(jìn)行計(jì)算了,都會(huì)使用這個(gè)參數(shù)進(jìn)行計(jì)算,
hive> set mapreduce.reduce.tasks; mapred.reduce.tasks=-1
以上是“hive中如何計(jì)算reduce的個(gè)數(shù)”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。