title: Increase number of Hive mappers in Hadoop 2
body: <p>I created a HBase table from Hive and I'm trying to do a simple aggregation on it. This is my Hive query:</p>
  
  <pre><code>from my_hbase_table 
  select col1, count(1) 
  group by col1;
  </code></pre>
  
  <p>The map reduce job spawns only 2 mappers and I'd like to increase that. With a plain map reduce job I would configure the yarn and mapper memory to increase the number of mappers. I tried the following in Hive but it did not work:</p>
  
  <pre><code>set yarn.nodemanager.resource.cpu-vcores=16;
  set yarn.nodemanager.resource.memory-mb=32768;
  set mapreduce.map.cpu.vcores=1;
  set mapreduce.map.memory.mb=2048;
  </code></pre>
  
  <p>NOTE: </p>
  
  <ul>
  <li>My test cluster has only 2 nodes</li>
  <li>The HBase table has more than 5M records</li>
  <li>Hive logs show HiveInputFormat and a number of splits=2</li>
  </ul>