yuqi1129 commented on code in PR #4879:
URL: https://github.com/apache/gravitino/pull/4879#discussion_r1778320626


##########
core/src/main/java/org/apache/gravitino/storage/relational/mapper/provider/base/GroupMetaBaseSQLProvider.java:
##########
@@ -34,6 +36,40 @@ public String selectGroupIdBySchemaIdAndName(
         + " AND deleted_at = 0";
   }
 
+  public String listGroupPOsByMetalake(@Param("metalakeName") String 
metalakeName) {
+    return "SELECT gt.group_id as groupId, gt.group_name as groupName, 
gt.metalake_id as metalakeId,"
+        + " gt.audit_info as auditInfo, gt.current_version as currentVersion, 
gt.last_version as lastVersion,"
+        + " gt.deleted_at as deletedAt FROM "
+        + GROUP_TABLE_NAME
+        + " gt JOIN "
+        + MetalakeMetaMapper.TABLE_NAME
+        + " mt ON gt.metalake_id = mt.metalake_id  WHERE mt.metalake_name = 
#{metalakeName}"

Review Comment:
   excessive space before WHERE



##########
common/src/main/java/org/apache/gravitino/dto/responses/GroupListResponse.java:
##########
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.dto.responses;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.Preconditions;
+import java.util.Arrays;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.ToString;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.gravitino.dto.authorization.GroupDTO;
+
+/** Represents a response for a list of groups. */
+@Getter
+@ToString
+@EqualsAndHashCode(callSuper = true)
+public class GroupListResponse extends BaseResponse {
+
+  @JsonProperty("groups")
+  private final GroupDTO[] groups;
+
+  /**
+   * Constructor for GroupListResponse.
+   *
+   * @param groups The array of group DTOs.
+   */
+  public GroupListResponse(GroupDTO[] groups) {
+    super(0);
+    this.groups = groups;
+  }
+
+  /** Default constructor for GroupListResponse. (Used for Jackson 
deserialization.) */
+  public GroupListResponse() {
+    super();
+    this.groups = null;
+  }
+
+  /**
+   * Validates the response data.
+   *
+   * @throws IllegalArgumentException if the name or audit is not set.
+   */
+  @Override
+  public void validate() throws IllegalArgumentException {
+    super.validate();
+
+    Preconditions.checkArgument(groups != null, "groups must not be null");
+    Arrays.stream(groups)
+        .forEach(
+            group -> {
+              Preconditions.checkArgument(
+                  StringUtils.isNotBlank(group.name()), "group 'name' must not 
be null and empty");

Review Comment:
   null or blank



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