Member since
10-12-2018
2
Posts
0
Kudos Received
0
Solutions
04-28-2020
09:04 AM
Problem Description In Impala, the following error occurs: [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 Attempting the same in Hive displays the following: 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 This issue occurs when the table in the backend has some null values for a given table or database. You need to clean up those nulls for table names before re-trying the DROP table options. Solution To resolve this issue, do the following to remove the Null Entry from the back end database: 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.
... View more