[ https://issues.apache.org/jira/browse/HIVE-27234?focusedWorklogId=859794&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-859794 ]
ASF GitHub Bot logged work on HIVE-27234: ----------------------------------------- Author: ASF GitHub Bot Created on: 29/Apr/23 17:19 Start Date: 29/Apr/23 17:19 Worklog Time Spent: 10m Work Description: zhangbutao commented on code in PR #4216: URL: https://github.com/apache/hive/pull/4216#discussion_r1181104998 ########## iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java: ########## @@ -676,6 +678,32 @@ public void executeOperation(org.apache.hadoop.hive.ql.metadata.Table hmsTable, } } + @Override + public void createBranchOperation(org.apache.hadoop.hive.ql.metadata.Table hmsTable, + AlterTableCreateBranchSpec createBranchSpec) { + TableDesc tableDesc = Utilities.getTableDesc(hmsTable); + Table icebergTable = IcebergTableUtil.getTable(conf, tableDesc.getProperties()); + + String branchName = createBranchSpec.getBranchName(); + ManageSnapshots manageSnapshots = icebergTable.manageSnapshots(); + Long snapShotId = Optional.ofNullable(createBranchSpec.getSnapshotId()) + .orElse(icebergTable.currentSnapshot().snapshotId()); + LOG.info("Creating branch {} on iceberg table {}.{}", branchName, hmsTable.getDbName(), + hmsTable.getTableName()); + manageSnapshots.createBranch(branchName, snapShotId); Review Comment: fixed. Issue Time Tracking ------------------- Worklog Id: (was: 859794) Time Spent: 3.5h (was: 3h 20m) > Iceberg: CREATE BRANCH SQL implementation > ------------------------------------------ > > Key: HIVE-27234 > URL: https://issues.apache.org/jira/browse/HIVE-27234 > Project: Hive > Issue Type: Sub-task > Components: Iceberg integration > Reporter: zhangbutao > Assignee: zhangbutao > Priority: Major > Labels: pull-request-available > Time Spent: 3.5h > Remaining Estimate: 0h > > Maybe we can follow spark sql about branch ddl implementation > [https://github.com/apache/iceberg/pull/6617] -- This message was sent by Atlassian Jira (v8.20.10#820010)