private boolean tagExist() {
    String tag =
        table.refs().entrySet().stream()
            .filter(entry -> entry.getValue().isTag())
            .map(Map.Entry::getKey)
            .filter(tagName::equals)
            .findFirst()
            .orElse(null);
    return tag != null;
  }
Action to auto create tag for Iceberg Table.
amoro-ams/src/main/java/org/apache/amoro/server/optimizing/maintainer/AutoCreateIcebergTagAction.java