Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Unable to create Hive external table after deleting underlying location files of the table.

Highlighted

Unable to create Hive external table after deleting underlying location files of the table.

Rising Star

I am unable to create external hive table after manually deleting underlying hdfs location files of the table.

 

when table desc is statement is issued, it gives the describe of the table, but when select is performed on the table, then we are getting table doesn't exists. So we issued drop statement. 

 

After issuing drop statement, then we again tried to create the table, but we are getting table already exists. Do we need to manually do a delete from the hive metastore ? or is there any way to forcefully re-create the table ? Please let me know. 

3 REPLIES 3
Highlighted

Re: Unable to create Hive external table after deleting underlying location files of the table.

@PentaReddy:

I guess table is not getting dropped. Please run repair statement and the run select statement to retrive the data. 

 

MSCK [REPAIR] TABLE table_name [ADD/DROP/SYNC PARTITIONS];

 

Highlighted

Re: Unable to create Hive external table after deleting underlying location files of the table.

Rising Star

We even ran the MSCK repair table, but still no luck. Any other options ?

Re: Unable to create Hive external table after deleting underlying location files of the table.

Champion

Could you try performing the "Validate hivemetastore schema "  from Cloudera manager - > Hive service then 

Let us know if you are able to create the same table.

Don't have an account?
Coming from Hortonworks? Activate your account here