You can specify the location of a partition while adding one. Location should be a directory though.
ALTER TABLE test ADD PARTITION(pt='01' ) LOCATION '/user/hive/warehouse/user'
On Sep 19, 2010, at 1:33 PM, lei liu wrote:
I use below statement to create one tabale and add one partition:
create external table test(userid bigint,name string, age int) partitioned by(pt string);
alter table test add partition(pt='01');
Now there is one file in HDFS, the file path is /user/hive/warehouse/user, I use load statement to load the file to partition: load data inpath '/user/hive/warehouse/user' into table test partition(pt='01'). I find the file path is changed, form /user/hive/warehouse/user to /user/hive/warehouse/test/pt=01. I want to do't change the file path, how can I do it?