justinmclean commented on code in PR #6037:
URL: https://github.com/apache/gravitino/pull/6037#discussion_r1899839999


##########
clients/cli/src/main/java/org/apache/gravitino/cli/commands/TagEntity.java:
##########
@@ -102,4 +110,33 @@ public void handle() {
 
     System.out.println(entity + " now tagged with " + all);
   }
+
+  private void checkTags(Table gTable) {
+    String[] associatedTags = gTable.supportsTags().listTags();
+    checkRedundantTags(associatedTags);
+  }
+
+  private void checkTags(Schema gSchema) {
+    String[] associatedTags = gSchema.supportsTags().listTags();
+    checkRedundantTags(associatedTags);
+  }
+
+  private void checkTags(Catalog gCatalog) {
+    String[] associatedTags = gCatalog.supportsTags().listTags();
+    checkRedundantTags(associatedTags);
+  }
+
+  private void checkRedundantTags(String[] associatedTags) {
+    List<String> redundantTags =

Review Comment:
   There is no real need to do this extra work as you can just check for the 
exception. There is also the (rare and unlikely) possibility that a tag could 
be added after this check, as this is not in a transaction.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to