- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to rename partition value in Hive?
- Labels:
-
Apache Hive
Created ‎12-30-2015 02:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Created ‎12-30-2015 04:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Nilesh Shrimant There is an issue with renaming partitions in hive 0.13 which is fixed in hive 0.14 I guess.
Possible workaround -
Setting fs.hdfs.impl.disable.cache=false and fs.file.impl.disable.cache=false
Refer https://issues.apache.org/jira/browse/HIVE-7623 for more details.
Created ‎12-30-2015 04:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Nilesh Shrimant There is an issue with renaming partitions in hive 0.13 which is fixed in hive 0.14 I guess.
Possible workaround -
Setting fs.hdfs.impl.disable.cache=false and fs.file.impl.disable.cache=false
Refer https://issues.apache.org/jira/browse/HIVE-7623 for more details.
Created ‎02-03-2016 02:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Nilesh Shrimant has this been resolved? Can you post your solution or accept the best answer?
Created ‎02-03-2016 07:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As @Gangadhar Kadam said it has problem in 0.13 but works fine in 0.14
Created ‎02-04-2016 10:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@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.
