[ https://issues.apache.org/jira/browse/HIVE-26927?focusedWorklogId=838878&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-838878 ]
ASF GitHub Bot logged work on HIVE-26927: ----------------------------------------- Author: ASF GitHub Bot Created on: 12/Jan/23 16:05 Start Date: 12/Jan/23 16:05 Worklog Time Spent: 10m Work Description: deniskuzZ commented on code in PR #3937: URL: https://github.com/apache/hive/pull/3937#discussion_r1068311288 ########## iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/IcebergTableUtil.java: ########## @@ -229,4 +229,17 @@ public static void rollback(Table table, AlterTableExecuteSpec.RollbackSpec.Roll } manageSnapshots.commit(); } + + /** + * Set the current snapshot for the iceberg table + * @param table the iceberg table + * @param value parameter of the rollback, that can be a timestamp in millis or a snapshot id + */ + public static void setCurrentSnapshot(Table table, Long value) { + ManageSnapshots manageSnapshots = table.manageSnapshots(); + LOG.debug("Setting the iceberg table {} from snapshot id {} to snapshot ID {}", table.name(), Review Comment: "Roll" / "Transition" the iceberg table ... ? Issue Time Tracking ------------------- Worklog Id: (was: 838878) Time Spent: 40m (was: 0.5h) > Iceberg: Add support for set_current_snapshotid > ----------------------------------------------- > > Key: HIVE-26927 > URL: https://issues.apache.org/jira/browse/HIVE-26927 > Project: Hive > Issue Type: Improvement > Components: Iceberg integration > Reporter: Rajesh Balamohan > Assignee: Ayush Saxena > Priority: Major > Labels: pull-request-available > Time Spent: 40m > Remaining Estimate: 0h > > Currently, hive supports "rollback" feature. Once rolledback, it is not > possible to move from older snapshot to newer snapshot. > It ends up throwing > {color:#0747a6}"org.apache.iceberg.exceptions.ValidationException: Cannot > roll back to snapshot, not an ancestor of the current state:" {color}error. > It will be good to support "set_current_snapshot" function to move to > different snapshot ids. > > -- This message was sent by Atlassian Jira (v8.20.10#820010)