[ https://issues.apache.org/jira/browse/HIVE-26228?focusedWorklogId=773521&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-773521 ]
ASF GitHub Bot logged work on HIVE-26228: ----------------------------------------- Author: ASF GitHub Bot Created on: 23/May/22 14:53 Start Date: 23/May/22 14:53 Worklog Time Spent: 10m Work Description: lcspinter commented on code in PR #3287: URL: https://github.com/apache/hive/pull/3287#discussion_r879553047 ########## iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/IcebergTableUtil.java: ########## @@ -184,4 +186,27 @@ public static void updateSpec(Configuration configuration, Table table) { public static boolean isBucketed(Table table) { return table.spec().fields().stream().anyMatch(f -> f.transform().toString().startsWith("bucket[")); } + + /** + * Roll an iceberg table's data back to a specific snapshot identified either by id or before a given timestamp. + * @param configuration a Hadoop configuration + * @param table the iceberg table + */ + public static void rollback(Configuration configuration, Table table) { + RollbackSpec rollbackSpec = SessionStateUtil.getResource(configuration, hive_metastoreConstants.ROLLBACK_SPEC) Review Comment: Compaction is a different animal. Directly passes the compaction type parameter to the HMS client, which will store everything in the HMS db compaction queue. Issue Time Tracking ------------------- Worklog Id: (was: 773521) Time Spent: 2h 20m (was: 2h 10m) > Implement Iceberg table rollback feature > ---------------------------------------- > > Key: HIVE-26228 > URL: https://issues.apache.org/jira/browse/HIVE-26228 > Project: Hive > Issue Type: New Feature > Reporter: László Pintér > Assignee: László Pintér > Priority: Major > Labels: pull-request-available > Time Spent: 2h 20m > Remaining Estimate: 0h > > We should allow rolling back iceberg table's data to the state at an older > table snapshot. > Rollback to the last snapshot before a specific timestamp > {code:java} > ALTER TABLE ice_t EXECUTE ROLLBACK('2022-05-12 00:00:00') > {code} > Rollback to a specific snapshot ID > {code:java} > ALTER TABLE ice_t EXECUTE ROLLBACK(1111); > {code} -- This message was sent by Atlassian Jira (v8.20.7#820007)