title: how to constraint hive query file output to be in a single file always
body: <p>I have created a hive table using below query, and inserting data to this table on daily basis using second query as mentioned below </p>
  
  <pre><code>create EXTERNAL table IF NOT EXISTS DB.efficacy
  (
  product string,
  TP_Silent INT,
  TP_Active INT,
  server_date date
  )
  
  ROW FORMAT DELIMITED
  FIELDS TERMINATED BY ','
  STORED AS TEXTFILE
  LOCATION 'hdfs://hdfsadlproduction/user/DB/Report/efficacy';
  
  Insert INTO DB.efficacy
  select 
      product,
      SUM(CASE WHEN verdict = 'TP_Silent' THEN 1 ELSE 0 END ),
      SUM(CASE WHEN verdict = 'TP_Active' THEN 1 ELSE 0 END ) ,
      current_date()
  from
      DB.efficacy_raw
  group by 
      product
  ;
  </code></pre>
  
  <p>The issue is that everyday when my insert query executes it basically creates a new file in hadoop FS. I want every day query output to get appended in a same single file only, but Hadoop FS contains the files in the following manner.
  000000_0, 000000_0_copy_1, 000000_0_copy_2</p>
  
  <p>I have used below hive settings:- </p>
  
  <pre><code>SET hive.execution.engine=mr;
  SET tez.queue.name=${queueName};
  SET mapreduce.job.queuename=${queueName};
  SET mapreduce.map.memory.mb  = 8192;
  SET mapreduce.reduce.memory.mb = 8192;
  SET hive.exec.dynamic.partition = true;
  SET hive.exec.dynamic.partition.mode = nonstrict;
  SET hive.exec.parallel = true;
  SET hive.exec.parallel.thread.number = 2;
  SET mapreduce.input.fileinputformat.split.maxsize=2048000000;
  SET mapreduce.input.fileinputformat.split.minsize=2048000000;
  SET mapreduce.job.reduces = 20;
  SET hadoop.security.credential.provider.path=jceks://hdfs/user/efficacy/s3-access/efficacy.jceks;
  set hive.vectorized.execution.enabled=false;
  set hive.enforce.bucketmapjoin=false;
  set hive.optimize.bucketmapjoin.sortedmerge=false;
  set hive.enforce.sortmergebucketmapjoin=false;
  set hive.optimize.bucketmapjoin=false;
  set hive.exec.dynamic.partition.mode=nostrict;
  set hive.exec.compress.intermediate=false;
  set hive.exec.compress.output=false;
  **set hive.exec.reducers.max=1;**
  </code></pre>
  
  <p>I am beginner into hive and hadoop era so pl excuse. Any help will be greatly appreciated </p>
  
  <p>Note:- I am using Hadoop 2.7.3.2.5.0.55-1</p>