Hive change table location for all partitions

Viewed 202

After moving my table's data to /some_loc, I am able to change its location with a command such as:

ALTER TABLE db.my_table SET LOCATION '/some_loc'; followed by

MSCK REPAIR TABLE db.my_table;

However, while this does move the table's location, the table is empty. When I do show partitions db.my_table; I see the partitions, but the are referencing the old location. I have to drop and recreate the table for the data to show up.

Is there a way make sure the partitions are pointing to the correct location when I change the location of the table?

0 Answers
Related