title: Hive loading in partitioned table
body: <p>I have a log file in HDFS, values are delimited by comma. For example:</p>
  
  <p><code>2012-10-11 12:00,opened_browser,userid111,deviceid222</code></p>
  
  <p>Now I want to load this file to Hive table which has columns "timestamp","action" and partitioned by "userid","deviceid". How can I ask Hive to take that last 2 columns in log file as partition for table? All examples <code>e.g. "hive&gt; LOAD DATA INPATH '/user/myname/kv2.txt' OVERWRITE INTO TABLE invites PARTITION (ds='2008-08-15');"</code> require definition of partitions in the script, but I want partitions to set up automatically from HDFS file.</p>
  
  <p>The one solution is to create intermediate non-partitioned table with all that 4 columns, populate it from file and then make an <code>INSERT into first_table PARTITION (userid,deviceid) select from intermediate_table timestamp,action,userid,deviceid;</code> but that is and additional task and we will have 2 very similiar tables.. Or we should create external table as intermediate.</p>