HIVE: Exception: Partition Already Exists while ADDING a NEW Partition to an EXISTING EXTERNAL Table

1.1k views Asked by At

I am getting the below error when the application (java) tries to execute an 'ADD partition' after 'DROP partition IF EXISTS' command in Hive:-

""" Caused by: java.sql.SQLException: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. AlreadyExistsException(message:Partition already exists: Partition(values:[xxxx, yyyy, zzzz-zz-zz, tttttttt], dbName:<db_name>, tableName:<tbl_name> """

Sequence of commands executed:- Thread A: USE <db_name> Thread B: ALTER TABLE <tbl_name> DROP IF EXISTS PARTITION(i_id ='xxxx', c_id ='yyyy', dt ='zzzz-zz-zz', time ='tttttttt') PURGE Thread C: ALTER TABLE <tbl_name> ADD PARTITION(i_id ='xxxx', c_id ='yyyy', dt ='zzzz-zz-zz', time ='tttttttt')

Note:- -Cluster - 5 Mgr nodes (Hive deployed on 3 of them), 3 Utils and 30 DNs -There are no signs of any latency issues in ambari-server alerts/logs during the timeframe when this error occurs. -It is an EXTERNAL hive table -This is a random occurrence (twice a week), associated with separate tables (not the same table everytime). 

Would appreciate any Help to understand what might be causing this issue (Partition ALready Exists) and suggest if I need to look into any other logs to find out the reason behind this.

0

There are 0 answers