justinmclean commented on code in PR #6037:
URL: https://github.com/apache/gravitino/pull/6037#discussion_r1899841131
##########
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 =
+ Arrays.stream(associatedTags)
+ .filter(x -> Arrays.asList(tags).contains(x))
+ .collect(Collectors.toList());
+ if (!redundantTags.isEmpty())
+ exitWithError(
+ "["
+ + COMMA_JOINER.join(redundantTags)
+ + "]"
+ + " are(is) already associated with "
Review Comment:
Please don't use "are(is)"
--
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]