[
https://issues.apache.org/jira/browse/HIVE-25057?focusedWorklogId=589740&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-589740
]
ASF GitHub Bot logged work on HIVE-25057:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 27/Apr/21 13:37
Start Date: 27/Apr/21 13:37
Worklog Time Spent: 10m
Work Description: lcspinter commented on a change in pull request #2219:
URL: https://github.com/apache/hive/pull/2219#discussion_r621215726
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/AbstractAlterTableOperation.java
##########
@@ -138,8 +141,32 @@ private void finalizeAlterTableWithWriteIdOp(Table table,
Table oldTable, List<P
environmentContext.putToProperties(HiveMetaHook.ALTER_TABLE_OPERATION_TYPE,
desc.getType().name());
if (partitions == null) {
long writeId = desc.getWriteId() != null ? desc.getWriteId() : 0;
- context.getDb().alterTable(desc.getDbTableName(), table,
desc.isCascade(), environmentContext, true,
- writeId);
+ try {
+ context.getDb().alterTable(desc.getDbTableName(), table,
desc.isCascade(), environmentContext, true, writeId);
+ } catch (HiveException ex) {
+ if
(environmentContext.getProperties().containsKey(HiveMetaHook.INITIALIZE_ROLLBACK_ALTER)
&& Boolean
+
.valueOf(environmentContext.getProperties().get(HiveMetaHook.INITIALIZE_ROLLBACK_ALTER)))
{
+ // in case of rollback of alter table do the following:
+ // 1. drop the already altered table but keep the data files
+ // 2. recreate the original table
+ // 3. run msck repair to sync partitions on filesystem with
metastore
Review comment:
I've removed the drop/create/msck part, and rolled back the serde,
input/output format, partition keys and table properties. An exception is also
thrown to notice the user we had an issue during migration and a `msck repair
table` should be issued to add the missing partition data to metastore.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 589740)
Time Spent: 6h (was: 5h 50m)
> Implement rollback for hive to iceberg migration
> ------------------------------------------------
>
> Key: HIVE-25057
> URL: https://issues.apache.org/jira/browse/HIVE-25057
> Project: Hive
> Issue Type: Improvement
> Reporter: László Pintér
> Assignee: László Pintér
> Priority: Major
> Labels: pull-request-available
> Time Spent: 6h
> Remaining Estimate: 0h
>
> This is a follow-up Jira of HIVE-25008.
> In case of an error during hive to iceberg migration, the original hive table
> must be restored.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)