public static void replaceTag(Table table, AlterTableSnapshotRefSpec.ReplaceSnapshotrefSpec replaceTagRefSpec) {
    String sourceTag = replaceTagRefSpec.getSourceRefName();
    long targetSnapshot = replaceTagRefSpec.getTargetSnapshot();
    LOG.info("Replacing tag {} with snapshot {} on iceberg table {}", sourceTag, targetSnapshot, table.name());
    ManageSnapshots manageSnapshots = table.manageSnapshots().replaceTag(sourceTag, targetSnapshot);
    setOptionalReplaceParams(replaceTagRefSpec, manageSnapshots, sourceTag);
    manageSnapshots.commit();
  }
Create a branch on the iceberg table
@param table the iceberg table
@param createBranchSpec Get the basic parameters needed to create a branch
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/IcebergSnapshotRefExec.java