无法增加 Hive Mapper 任务? [英] Fail to Increase Hive Mapper Tasks?
问题描述
我有一个托管的 Hive 表,其中仅包含一个 150MB 的文件.然后我对它执行从 tbl 中选择计数(*)",它使用 2 个映射器.我想将其设置为更大的数字.
I have a managed Hive table, which contains only one 150MB file. I then do "select count(*) from tbl" to it, and it uses 2 mappers. I want to set it to a bigger number.
首先我尝试了 'set mapred.max.split.size=8388608;',所以希望它会使用 19 个映射器.但它只使用了 3.不知何故,它仍然将输入分成 64MB.我也使用了'set dfs.block.size=8388608;',也没有工作.
First I tried 'set mapred.max.split.size=8388608;', so hopefully it will use 19 mappers. But it only uses 3. Somehow it still split the input by 64MB. I also used 'set dfs.block.size=8388608;', not working either.
然后我尝试了一个普通的 map-reduce 工作来做同样的事情.它最初使用 3 个映射器,当我设置 mapred.max.split.size 时,它使用 19 个.所以我想问题出在 Hive 上.
Then I tried a vanilla map-reduce job to do the same thing. It initially uses 3 mappers, and when I set mapred.max.split.size, it uses 19. So the problem lies in Hive, I suppose.
我阅读了一些 Hive 源代码,如 CombineHiveInputFormat、ExecDriver 等,找不到线索.
I read some of the Hive source code, like CombineHiveInputFormat, ExecDriver, etc. can't find a clue.
我还可以使用哪些设置?
What else settings can I use?
推荐答案
我将@javadba 的回答与我从 Hive 邮件列表中收到的回答结合起来,这是解决方案:
I combined @javadba 's answer with that I received from Hive mailing list, here's the solution:
set hive.input.format=org.apache.hadoop.hive.ql.io.HiveInputFormat;
set mapred.map.tasks = 20;
select count(*) from dw_stage.st_dw_marketing_touch_pi_metrics_basic;
来自邮件列表:
HIVE 似乎正在使用旧的 Hadoop MapReduce API,因此 mapred.max.split.size 将不起作用.
It seems that HIVE is using the old Hadoop MapReduce API and so mapred.max.split.size won't work.
我稍后会深入研究源代码.
I would dig into source code later.
这篇关于无法增加 Hive Mapper 任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!