Marta Kuczora created HIVE-18699:

             Summary: Check for duplicate partitions in 
                 Key: HIVE-18699
             Project: Hive
          Issue Type: Bug
          Components: Metastore
            Reporter: Marta Kuczora
            Assignee: Marta Kuczora

The HiveMetastore.exchange_partitions method throws the following exception if 
the dest table already contains a partition with the same values as the 
partition to be exchanged.
org.apache.hadoop.hive.metastore.api.MetaException: Insert of object 
"org.apache.hadoop.hive.metastore.model.MPartition@4e78fff5" using statement 
(?,?,?,?,?,?)" failed : The statement was aborted because it would have caused 
a duplicate key value in a unique or primary key constraint or unique index 
identified by 'UNIQUEPARTITION' defined on 'PARTITIONS'.
This use case could be handled better by checking if the partition already 
exists in dest table and if it is, throw a MetaException with a proper error 

This message was sent by Atlassian JIRA

Reply via email to