Created 09-21-2016 10:02 PM
I want to change my external table hdfs location to new path location which is Amazon S3 in my case.
I tried following query.
ALTER TABLE table_name set location 's3n://bucket/path/to/data'
But some how it is still pointing to old hdfs external path.
Is there any query I need to use in order to update hive metastore with new external data path location.
Any kind of help would be greatly appreciated .
Created 09-22-2016 02:54 AM
what happened right after you executed the Alter table command? Did you get any errors?
I am assuming, you tried describe extended <table_name> to determine the location that it is referring to??
Created 09-22-2016 11:00 PM
@hduraiswamy I am able to execute alter query, I didn't get any errors . Yes i have tried extended describe command as well to get location info.
Created 09-22-2016 03:17 AM
DROP the current table (files on HDFS are not affected for external tables), and create a new one with the same name pointing to your S3 location.
Created 09-22-2016 11:06 PM
@Predrag Minovic I also tried this work around it is working partially for me as i have to recover all the table partition because somehow it doesn't detect s3 sub directories .
Created 09-22-2016 09:17 AM
Check if you have provided the aws access keys correctly and if there are any exceptions reported in hive client log (e.g /tmp/<user>/hive.log).
Created 09-22-2016 11:02 PM
@Rajesh Balamohan I have aws access id & secret stored in in hive-site and hdfs-site config file.
Created 09-24-2016 01:30 AM
are there any exceptions reported in client log or in metastore log?
Created 06-10-2017 01:18 PM
on hive terminal run below command
alter table FpML_Data set location hdfs:/file_path_in_HDFS;
HDFS: is value against fs.defaultFS property in core-site.xml
Reply my comment if in case any query...
Created 06-10-2017 03:37 PM
Note, when you change the location of the file by using alter command, the old data file is not moved to new location.
On your issue, 1) do you have any data files in the mentioned path?
2) Did you get any warnings / errors while you executed this ALTER command?