Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to rename partition value in Hive?

avatar
Contributor

We have a table with partitions as p_date/p_workflow/p_attempt, we have data in p_date as "2016-10-15" which we need to change to "2015-10-15". Query we used is "alter table "table_name" partition (p_date='2016-10-15' ,p_workflow_id='0000450-151026183415051-oozie-oozi-W', p_attempt=0) rename to partition (p_date='2015-10-25' ,p_workflow_id='0000450-151026183415051-oozie-oozi-W', p_attempt=0);" which is yielding error "FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Unable to rename partition."

Hive version is Hive 0.13.0.2.1.3.0-563

1 ACCEPTED SOLUTION

avatar
Expert Contributor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
4 REPLIES 4

avatar
Expert Contributor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar
Master Mentor

@Nilesh Shrimant has this been resolved? Can you post your solution or accept the best answer?

avatar
Expert Contributor

As @Gangadhar Kadam said it has problem in 0.13 but works fine in 0.14

avatar
Contributor

@Gangadhar Kadam , thanks for the suggestion, but we circumvent the problem in an unethical way. We took table backup and then renamed partitions in Hive warehouse and then ran msck repair table command. It created new partitions in Hive which were renamed and then we created directories with old partition names and dropped them with drop partition command deleting metastore entry.