How to add mutiple partition columns to the hive table?

How to add mutiple partition columns to the table in hive?

Let us assume our table is partitioned by two columns createtime,loadtime.


hive> show partitions account.product;
OK
createtime=20160801/loadtime=20160808


Now I have data file with loadtime as '20160809' createtime as '20160801'

Data Path:
/user/jobs/account/product/createtime=20160801/loadtime=20160809/part-m-00000

I want to add above data file with new loadtime as above:

Now the query looks like below:

hive> ALTER TABLE ACCOUNT.PRODUCT ADD PARTITION(createtime=20160801,loadtime=20160808)
hive> LOCATION '/user/jobs/account/product/createtime=20160801/loadtime=20160809';
OK
Time taken: 2.1 seconds
hive>

Comments