title: Hive: Need to specify partition columns because the destination table is partitioned
body: <p>I'm wondering if it's possible in Hive to insert a non-partitioned table into one that <em>is</em> partitioned. The first table is as follows:</p>
  
  <pre><code>hive&gt; describe extended user_ratings;
  OK
  userid                  int                                         
  movieid                 int                                         
  rating                  int                                         
  unixtime                int                                         
  
  Detailed Table Information  Table(tableName:user_ratings, dbName:ml, owner:cloudera, createTime:1500142667, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:userid, type:int, comment:null), FieldSchema(name:movieid, type:int, comment:null), FieldSchema(name:rating, type:int, comment:null), FieldSchema(name:unixtime, type:int, comment:null)], location:hdfs://quickstart.cloudera:8020/user/hive/warehouse/ml.db/user_ratings, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:-1, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=    , field.delim=
  Time taken: 0.418 seconds, Fetched: 6 row(s)
  </code></pre>
  
  <p>The new table is thus:</p>
  
  <pre><code>hive&gt; describe extended rating_buckets;
  OK
  userid                  int                                         
  movieid                 int                                         
  rating                  int                                         
  unixtime                int                                         
  genre                   string                                      
  
  # Partition Information      
  # col_name              data_type               comment             
  
  genre                   string                                      
  
  Detailed Table Information  Table(tableName:rating_buckets, dbName:default, owner:cloudera, createTime:1500506879, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:[FieldSchema(name:userid, type:int, comment:null), FieldSchema(name:movieid, type:int, comment:null), FieldSchema(name:rating, type:int, comment:null), FieldSchema(name:unixtime, type:int, comment:null), FieldSchema(name:genre, type:string, comment:null)], location:hdfs://quickstart.cloudera:8020/user/hive/warehouse/rating_buckets, inputFormat:org.apache.hadoop.mapred.TextInputFormat, outputFormat:org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat, compressed:false, numBuckets:8, serdeInfo:SerDeInfo(name:null, serializationLib:org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, parameters:{serialization.format=  , field.delim=
  Time taken: 0.46 seconds, Fetched: 12 row(s)
  </code></pre>
  
  <p>It seems to be counting the partition ("genre") as being the same as the other columns...did I maybe create it wrong?</p>
  
  <p>Anyways, here's what happens when I try to do an INSERT OVERWRITE into the new table:</p>
  
  <pre><code>hive&gt; FROM ml.user_ratings
      &gt; INSERT OVERWRITE TABLE rating_buckets
      &gt; select userid, movieid, rating, unixtime;
  FAILED: SemanticException 2:23 Need to specify partition columns because the destination table is partitioned. Error encountered near token 'rating_buckets'
  </code></pre>
  
  <p>Should I just recreate the first table with a partition? Is there a way to copy the first table over and leave the partition untouched?</p>