Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#6030] fix(CLI): Fix Setting the same tags multiple times in the Gravitino CLi gives unexpected output (#6037)

Lord of Abyssfb756169805d
diff --git a/clients/cli/src/main/java/org/apache/gravitino/cli/commands/TagEntity.java b/clients/cli/src/main/java/org/apache/gravitino/cli/commands/TagEntity.java
index d2d1cbbe18..7bc8ec3764 100644
--- a/clients/cli/src/main/java/org/apache/gravitino/cli/commands/TagEntity.java
+++ b/clients/cli/src/main/java/org/apache/gravitino/cli/commands/TagEntity.java
@@ -29,6 +29,7 @@ import org.apache.gravitino.exceptions.NoSuchCatalogException;
import org.apache.gravitino.exceptions.NoSuchMetalakeException;
import org.apache.gravitino.exceptions.NoSuchSchemaException;
import org.apache.gravitino.exceptions.NoSuchTableException;
+import org.apache.gravitino.exceptions.TagAlreadyAssociatedException;
import org.apache.gravitino.rel.Table;
public class TagEntity extends Command {
@@ -94,6 +95,8 @@ public class TagEntity extends Command {
exitWithError(ErrorMessages.UNKNOWN_SCHEMA);
} catch (NoSuchTableException err) {
exitWithError(ErrorMessages.UNKNOWN_TABLE);
+ } catch (TagAlreadyAssociatedException err) {
+ exitWithError("Tags are already associated with " + name.getName());
} catch (Exception exp) {
exitWithError(exp.getMessage());
}