1

Initially I create a Hive external table following location

hdfs://user/temp2

and then I altered the location to following.

hdfs://user/temp3

Now even after running MSCK repair table my table is pointing to old location (hdfs://user/temp2)

The table is dynamically partitioned.

4

1 回答 1

2

The thing is your table is partitioned and partitions have their own old locations. For external table the easiest way is to drop and create table + repair table, this will create partitions on top of new location subdirectories.

Steps to be done are:

DROP TABLE abc;

CREATE EXTERNAL TABLE abc ... location 'hdfs://user/temp3';

MSCK REPAIR TABLE abc;
于 2018-12-01T11:02:45.597 回答