title: data reload from one table to another in hive
body: <p>i am loading data from one table into another in hive, while the new properties of the new table differ from the original. </p>
  
  <p>While loading i am facing the below issue... Any help to fix this... ?</p>
  
  <pre><code>java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while processing row {"mdse_item_i":671841,"co_loc_i":146,"persh_expr_d":"2014-05-01","greg_d":"2013-06-17","persh_oh_q":16.0,"crte_btch_i":765,"updt_btch_i":765,"range_n":"ITEM_LOC_DAY_PERSH_OH_INV_2013-04-01_2013-07-31"}
      at org.apache.hadoop.hive.ql.exec.ExecMapper.map(ExecMapper.java:159)
      at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50)
      at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:417)
      at org.apache.hadoop.mapred.MapTask.run(MapTask.java:332)
      at org.apache.hadoop.mapred.Child$4.run(Child.java:268)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.Subject.doAs(Subject.java:396)
      at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1408)
      at org.apache.hadoop.mapred.Child.main(Child.java:262)
  Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while processing row {"mdse_item_i":671841,"
  </code></pre>
  
  <p>My old table defntn:</p>
  
  <pre><code>hive&gt; describe nonclickstream.ITEM_LOC_DAY_PERSH_OH_INV;
  OK
  mdse_item_i     int
  co_loc_i        int
  persh_expr_d    string
  greg_d  string
  persh_oh_q      double
  crte_btch_i     int
  updt_btch_i     int
  range_n string
  </code></pre>
  
  <p>Time taken: 0.058 seconds</p>
  
  <p>My new table def. is below:</p>
  
  <pre><code>hive&gt; describe ITEM_LOC_DAY_PERSH_OH_INV;
  OK
  mdse_item_i     int     from deserializer
  co_loc_i        int     from deserializer
  persh_expr_d    string  from deserializer
  greg_d  string  from deserializer
  persh_oh_q      string  from deserializer
  crte_btch_i     int     from deserializer
  updt_btch_i     int     from deserializer
  greg_date       string
  Time taken: 0.241 seconds
  </code></pre>
  
  <p>The new one is created with avro schema.</p>
  
  <pre><code>CREATE external TABLE ITEM_LOC_DAY_PERSH_OH_INV
  partitioned by (greg_date string)
  ROW FORMAT SERDE
  'org.apache.hadoop.hive.serde2.avro.AvroSerDe'
  STORED AS INPUTFORMAT
  'org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat'
  OUTPUTFORMAT
  'org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat'
  Location '/common/TD/INV_new/ITEM_LOC_DAY_PERSH_OH_INV/'
  TBLPROPERTIES (
  'avro.schema.url'='hdfs:///common/TD/INV_new/ITEM_LOC_DAY_PERSH_OH_INV/ITEM_LOC_DAY_PERSH_OH_INV.avs');
  </code></pre>
  
  <p>Load command we are using:</p>
  
  <pre><code>INSERT INTO TABLE ITEM_LOC_DAY_PERSH_OH_INV PARTITION (greg_date)
  SELECT 
  mdse_item_i,
  co_loc_i,
  persh_expr_d,
  greg_d,
  persh_oh_q,
  crte_btch_i,
  updt_btch_i,
  greg_d FROM nonclickstream.ITEM_LOC_DAY_PERSH_OH_INV where range_n='ITEM_LOC_DAY_PERSH_OH_INV_2013-04-01_2013-07-31';
  </code></pre>
  
  <p>we are using dynamic partitioning while loading! </p>
  
  <p>Actually what we are trying to do is re-partitioning the table with another column. while modified the schema also. </p>
  
  <p>The same approach worked for other tables... but for only this table we are facing this issue......</p>