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


##########
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);
+  }

Review Comment:
   I wouldn't structure the code this way because this thin layer of 
`checkTags` can/should be compressed into the `handle` method.
   We may want to split the `handle` method for catalog, schema and table, 
instead.
   That method is growing and there are chunks of `if...else` in it.
   
   By the way, I wouldn't call tags "redundant", you are checking if tags are 
"duplicated". This is a nit though.



-- 
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