private static boolean refExistsAsTag(Table table, String tagName) {
    SnapshotRef tagRef = table.refs().get(tagName);
    if (tagRef != null) {
      if (tagRef.isTag()) {
        return true;
      } else {
        throw new IllegalArgumentException(
            "Cannot complete create tag operation on " + tagName + ", as it exists as Branch");
      }
    }
    return false;
  }
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