title: How to reduce generating files of SQL "Alter Table/Partition Concatenate" in Hive?
body: <p>Hive version: 1.2.1</p>
  
  <p>Configuration:</p>
  
  <pre><code>set hive.execution.engine=tez;
  set hive.merge.mapredfiles=true;
  set hive.merge.smallfiles.avgsize=256000000;
  set hive.merge.tezfiles=true;
  </code></pre>
  
  <p>HQL:</p>
  
  <pre><code>ALTER TABLE `table_name` PARTITION (partion_name1 = 'val1', partion_name2='val2', partion_name3='val3', partion_name4='val4') CONCATENATE;
  </code></pre>
  
  <p>I use the HQL to merge files of specific table / partition. However, after execution there are still many files in output directory; and their size are far less than 256000000. So how to decrease the number of output files.</p>
  
  <p>BTW, use MapReduce instead of Tez also didn't work.</p>