title: Hive map only job/stages creating multiple zero byte file
body: <p>I have a hive query which has multiple joins , so as number of stages. While executing the query in some scenario, there won’t be any output. In these scenarios the job completes at intermediate stage where the no of mappers is N and no of reducers is 0 ( No reducer) which creates N no of zero byte files</p>
  
  <p>Tried providing the following settings </p>
  
  <pre><code>set hive.merge.mapfiles=true 
  set hive.merge.mapredfiles=true 
  set hive.merge.smallfiles.avgfilesize=128000000
  set hive.merge.size.per.task=256000000
  </code></pre>
  
  <p>If there is some records in the output we are getting the expected output as per the settings</p>
  
  <p>Basically it happens as a result when no records outputs for a map only job/stage.</p>
  
  <p>I am getting 0byte output as single file if config is set for no of reducers as 1 (all the stage of query uses single reducer )or the compress output as true. Still a 0byte file will be there </p>
  
  <p>A solution would be appreciated. Thanks in advance</p>