@Override
  public void alterTableSnapshotRefOperation(org.apache.hadoop.hive.ql.metadata.Table hmsTable,
      AlterTableSnapshotRefSpec alterTableSnapshotRefSpec) {
    TableDesc tableDesc = Utilities.getTableDesc(hmsTable);
    Table icebergTable = IcebergTableUtil.getTable(conf, tableDesc.getProperties());

    switch (alterTableSnapshotRefSpec.getOperationType()) {
      case CREATE_BRANCH:
        AlterTableSnapshotRefSpec.CreateSnapshotRefSpec createBranchSpec =
            (AlterTableSnapshotRefSpec.CreateSnapshotRefSpec) alterTableSnapshotRefSpec.getOperationParams();
        IcebergSnapshotRefExec.createBranch(icebergTable, createBranchSpec);
        break;
      case CREATE_TAG:
        if (icebergTable.currentSnapshot() == null) {
          throw new UnsupportedOperationException(
              String.format("Cannot alter %s on iceberg table %s.%s which has no snapshot",
                  alterTableSnapshotRefSpec.getOperationType().getName(), hmsTable.getDbName(),
                  hmsTable.getTableName()));
        }
        AlterTableSnapshotRefSpec.CreateSnapshotRefSpec createTagSpec =
            (AlterTableSnapshotRefSpec.CreateSnapshotRefSpec) alterTableSnapshotRefSpec.getOperationParams();
        IcebergSnapshotRefExec.createTag(icebergTable, createTagSpec);
        break;
      case DROP_BRANCH:
        AlterTableSnapshotRefSpec.DropSnapshotRefSpec dropBranchSpec =
            (AlterTableSnapshotRefSpec.DropSnapshotRefSpec) alterTableSnapshotRefSpec.getOperationParams();
        IcebergSnapshotRefExec.dropBranch(icebergTable, dropBranchSpec);
        break;
      case RENAME_BRANCH:
        AlterTableSnapshotRefSpec.RenameSnapshotrefSpec renameSnapshotrefSpec =
            (AlterTableSnapshotRefSpec.RenameSnapshotrefSpec) alterTableSnapshotRefSpec.getOperationParams();
        IcebergSnapshotRefExec.renameBranch(icebergTable, renameSnapshotrefSpec);
        break;
      case REPLACE_SNAPSHOTREF:
        AlterTableSnapshotRefSpec.ReplaceSnapshotrefSpec replaceSnapshotrefSpec =
            (AlterTableSnapshotRefSpec.ReplaceSnapshotrefSpec) alterTableSnapshotRefSpec.getOperationParams();
        if (replaceSnapshotrefSpec.isReplaceBranch()) {
          IcebergSnapshotRefExec.replaceBranch(icebergTable, replaceSnapshotrefSpec);
        } else {
          IcebergSnapshotRefExec.replaceTag(icebergTable, replaceSnapshotrefSpec);
        }
        break;
      case DROP_TAG:
        AlterTableSnapshotRefSpec.DropSnapshotRefSpec dropTagSpec =
            (AlterTableSnapshotRefSpec.DropSnapshotRefSpec) alterTableSnapshotRefSpec.getOperationParams();
        IcebergSnapshotRefExec.dropTag(icebergTable, dropTagSpec);
        break;
      default:
        throw new UnsupportedOperationException(String.format(
            "Operation type %s is not supported", alterTableSnapshotRefSpec.getOperationType().getName()));
    }
  }
Iceberg's optimistic concurrency control fails to provide means for IOW and Insert operations isolation.
Use `hive.txn.ext.locking.enabled` config to create Hive locks in order to guarantee data consistency.
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java