1
votes

I have a hive table under a schema with 5 partitions

  1. Country Code (Filled Values KR, CP)
  2. Organization Code (Filled values GCB, PKR)
  3. Product Code (CRD,PCL)
  4. Data Unit (CKI)
  5. Report Period ()

There are about 9000 partition values, I am trying to unlock a table with the below command

unlock schema.Table-name PARTITION(country_code='KR');

Error that happens is:

Return code 1 from org.apache.hadoop.hive.q1.exec.DDLTask.partion spec {country_code=KR} doesnt contain all (5) partition columns

Can someone provide a query/solution by which I can unlock the table partitions based on a single partition value?

1
I think you have to specify the full partition key (all 5 columns). Are all 9000 partitions locked? Can you restart your Hive server? That sure sounds like the simplest solution to me. - Andrew
Thank you for your answer but this seems to a be temporary solution, as these queries are run into a batch, again the locks would be acquired post running queries against Country Code KR as value of other partition changes around it. So i am looking for a more concrete solution. - user2068462

1 Answers

1
votes

2 years later, but it might still help somebody.. The query is missing the keyword table I think...

The following query is working fine for me: unlock table database.cs_generator PARTITION(config_id = '247', d_date = '2019-01-25')