Mayuran Yogarajah wrote:
I have a table which has a partition that I load data into with:
LOAD DATA INPATH 'filepath' INTO TABLE summary PARTITION('..');
However, this moves the file addressed by /filepath/ into the table or
partition. I
found out from the mailing list that I can get around this by doing:
CREATE EXTERTAL TABLE mytable (...) ... LOCATION "hdfs://.../"
But this doesn't allow me to specify a partition. Is there some way I
can call
LOAD DATA and have Hive not move the file its loading?
thanks
In case others are having this issue, you can do this by:
CREATE EXTERNAL TABLE mytable( .. )
PARTITIONED BY (dt STRING)
..
STORED AS TEXTFILE LOCATION '/user/hadoop';
ALTER TABLE mytable ADD PARTITION (dt='2009-09-16') LOCATION
'/user/hadoop/2009-09-16';
M