Sometimes, some unconventional operations can cause the database/table to be established to conflict with the database/table stored in the Metastore, resulting in the inability to establish the corresponding database/table. For example, if you do not use the regular drop database/table to delete a database or a table, but instead delete the corresponding folder or file directly on HDFs, such as:/user/hive/warehouse/xxxxx.db, Then when you re-try to build the library using the Build library script, you might be able to quote:
Failed:execution Error, return code 1 from Org.apache.hadoop.hive.ql.exec.DDLTask. Org.apache.thrift.TApplicationException:Internal Error processing Get_partition_names
( Note: In order to delete a database completely and cleanly, we can choose to drop a db using the CASCADE keyword, for example: drop database if exists your-database Cascade ;)
Of course, this is the reported partition information is confusing, there may be other meta-data problems, we only use this error message as an example to illustrate the solution:
Yes, the reason is, as mentioned above, you are going to build the library and Metastore in the library to save the metadata conflict, at this time, we can only manually delete the relevant data in Metastore! Connected to the database used by Metastore (this is assumed to be MySQL), this error is related to partition, so we want to clear the partition table information, if we have only one library, we can simply and brutally empty these tables:
TRUNCATE TABLE partition_key_vals;truncate table partition_params;truncate table partitions;
If you have multiple libraries, then you need to use Delete table .... To selectively delete the partition information from the table in the specified library.
Hive:TApplicationException:Internal Error processing Get_partition_names wrong workaround