title: What is Hive: Return Code 2 from org.apache.hadoop.hive.ql.exec.MapRedTask
body: <p>I am getting:</p>
  
  <pre><code>FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.MapRedTask
  </code></pre>
  
  <p>While trying to make a copy of a partitioned table using the commands in the hive console:</p>
  
  <pre><code>CREATE TABLE copy_table_name LIKE table_name;
  INSERT OVERWRITE TABLE copy_table_name PARTITION(day) SELECT * FROM table_name;
  </code></pre>
  
  <p>I initially got some semantic analysis errors and had to set:</p>
  
  <pre><code>set hive.exec.dynamic.partition=true
  set hive.exec.dynamic.partition.mode=nonstrict
  </code></pre>
  
  <p>Although I'm not sure what the above properties do? </p>
  
  <p>Full ouput from hive console:</p>
  
  <pre><code>Total MapReduce jobs = 1
  Launching Job 1 out of 1
  Number of reduce tasks determined at compile time: 1
  In order to change the average load for a reducer (in bytes):
    set hive.exec.reducers.bytes.per.reducer=&lt;number&gt;
  In order to limit the maximum number of reducers:
    set hive.exec.reducers.max=&lt;number&gt;
  In order to set a constant number of reducers:
    set mapred.reduce.tasks=&lt;number&gt;
  Starting Job = job_201206191101_4557, Tracking URL = http://jobtracker:50030/jobdetails.jsp?jobid=job_201206191101_4557
  Kill Command = /usr/lib/hadoop/bin/hadoop job  -Dmapred.job.tracker=master:8021 -kill job_201206191101_4557
  2012-06-25 09:53:05,826 Stage-1 map = 0%,  reduce = 0%
  2012-06-25 09:53:53,044 Stage-1 map = 100%,  reduce = 100%
  Ended Job = job_201206191101_4557 with errors
  FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.MapRedTask
  </code></pre>