If you want to insert data into a partitioned table without specifying the partition value, you need to enable dynamic partitioning. You can use the following switches:
SET hive.exec.dynamic.partition=true; SET hive.exec.dynamic.partition.mode=nonstrict; Thanks Vaibhav From: Daniel,Wu [mailto:hadoop...@163.com] Sent: Thursday, August 11, 2011 11:30 PM To: hive Subject: how to load data to partitioned table suppose the table is partitioned by period_key, and the csv file also has a column named as period_key. The csv file contains multiple days of data, how can we load it in the the table? I think of an workaround by first load the data into a non-partition table, and then insert the data from non-partition table to the partition table. hive> INSERT OVERWRITE TABLE sales SELECT * FROM sales_temp; FAILED: Error in semantic analysis: need to specify partition columns because the destination table is partitioned. However it doesn't work also. please help.