"ERROR: ImpalaRuntimeException: Error making 'dropDatabase' RPC to Hive Metastore:/" in CDP and "FAILED: SemanticException Unable to fetch table test_wide. null (state=42000,code=40000" in Hive
- Oct 5, 2026 8:56 AM UTC
- 0 replies
- 4060 views
- Translate All
Problem Description
[ip-10-45-1-222.ec2.internal:21000] default> drop database test cascade;
Query: drop database test cascade
ERROR: ImpalaRuntimeException: Error making 'dropDatabase' RPC to Hive Metastore:
CAUSED BY: TTransportException: null
0: jdbc:hive2://localhost:10000/default> drop database test cascade;
Error: Error while compiling statement: FAILED: SemanticException Unable to fetch table test_wide. null (state=42000,code=40000)
0: jdbc:hive2://localhost:10000/default>
Cause
Solution
Note: Ensure you take a Mysql backup. This solution is NOT recommended for production use. Contact Cloudera support for the production usage
- Go to MySQL
- Run the following command on the Back End DB into Mysql. (test.test_wide)
1>select DB_ID from DBS where NAME='test'; Make a note of the DB_ID
2>select tbl_id from TBLS where TBL_NAME='test_wide' and DB_ID=<from step1>;
Make a note of the TBL_ID
3> Once you got the right TBL_ID, you can run the following, Replace the TBL_ID if necessary, as I did the repro using your Provided DB the TBL_ID ideally will be the same although do confirm the same.
4> Delete from PARTITION_KEY_VALS WHERE PART_ID in (select PART_ID from PARTITIONS where TBL_ID=step 2 id);
5> Delete from PARTITION_PARAMS WHERE PART_ID in (select PART_ID from PARTITIONS where TBL_ID=step 2 id);
6> Delete from PARTITIONS where TBL_ID=step2 id;
7> Delete from TBL_COL_PRIVS where TBL_ID=step2 id;
8> Delete from TBL_PRIVS where TBL_ID=step2 ;
9> Delete from TBLS where TBL_ID=step 2;
10> COMMIT; - Now Go back to beeline and try the drop table again.

