shaofengshi commented on code in PR #5293:
URL: https://github.com/apache/gravitino/pull/5293#discussion_r1838241764


##########
clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoCommandLine.java:
##########
@@ -459,6 +463,31 @@ private void handleColumnCommand() {
     }
   }
 
+  /**
+   * Handles the command execution for Objects based on command type and the 
command line options.
+   */
+  private void handleOwnerCommand() {
+    String url = getUrl();
+    FullName name = new FullName(line);
+    String metalake = name.getMetalakeName();
+    String entityName = line.getOptionValue(GravitinoOptions.NAME);
+
+    if (CommandActions.DETAILS.equals(command)) {
+      new OwnerDetails(url, ignore, metalake, entityName, entity).handle();
+    } else if (CommandActions.UPDATE.equals(command)) {
+      String owner = line.getOptionValue(GravitinoOptions.USER);
+      String group = line.getOptionValue(GravitinoOptions.GROUP);
+
+      if (owner != null && group == null) {
+        new SetOwner(url, ignore, metalake, entityName, entity, owner, 
false).handle();
+      } else if (owner == null && group != null) {
+        new SetOwner(url, ignore, metalake, entityName, entity, group, 
true).handle();
+      } else {
+        System.err.println(ErrorMessages.INVALID_OWNER_COMMAND);
+      }
+    }

Review Comment:
   If the command is not "details" nor "update", now it does nothing. It would 
be better to output something here, let the user know the command is not 
supported? 



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