yuqi1129 commented on code in PR #4109:
URL: https://github.com/apache/gravitino/pull/4109#discussion_r1677708736
##########
core/src/main/java/com/datastrato/gravitino/storage/relational/mapper/TagMetaMapper.java:
##########
@@ -43,16 +43,41 @@ public interface TagMetaMapper {
+ TAG_TABLE_NAME
+ " tm JOIN "
+ MetalakeMetaMapper.TABLE_NAME
- + " mm on tm.metalake_id = mm.metalake_id"
+ + " mm ON tm.metalake_id = mm.metalake_id"
+ " WHERE mm.metalake_name = #{metalakeName} AND tm.deleted_at = 0
AND mm.deleted_at = 0")
List<TagPO> listTagPOsByMetalake(@Param("metalakeName") String metalakeName);
+ @Select(
+ "<script>"
+ + "SELECT tm.tag_id as tagId, tm.tag_name as tagName,"
+ + " tm.metalake_id as metalakeId,"
+ + " tm.tag_comment as comment,"
+ + " tm.properties as properties,"
+ + " tm.audit_info as auditInfo,"
+ + " tm.current_version as currentVersion,"
+ + " tm.last_version as lastVersion,"
+ + " tm.deleted_at as deletedAt"
+ + " FROM "
+ + TAG_TABLE_NAME
+ + " tm JOIN "
+ + MetalakeMetaMapper.TABLE_NAME
+ + " mm ON tm.metalake_id = mm.metalake_id"
+ + " WHERE mm.metalake_name = #{metalakeName} AND tm.tag_name IN"
Review Comment:
Adding a space after `IN` is preferable.
##########
core/src/main/java/com/datastrato/gravitino/EntityStore.java:
##########
@@ -181,4 +182,14 @@ default boolean delete(NameIdentifier ident, EntityType
entityType) throws IOExc
*/
<R, E extends Exception> R executeInTransaction(Executable<R, E> executable)
throws E, IOException;
+
+ /**
+ * Get the extra tag operations that are supported by the entity store.
+ *
+ * @return the tag operations object that are supported by the entity store
+ * @throws UnsupportedOperationException if the extra operations are not
supported
+ */
+ default SupportsTagOperations tagOperations() {
+ throw new UnsupportedOperationException("extra operations are not
supported");
Review Comment:
extra operations -> tag operatoins
##########
api/src/main/java/com/datastrato/gravitino/exceptions/TagAlreadyAssociatedException.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * 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 com.datastrato.gravitino.exceptions;
+
+import com.google.errorprone.annotations.FormatMethod;
+
+/** Exception thrown when a tag with specified name already associated to a
metadata object. */
+public class TagAlreadyAssociatedException extends AlreadyExistsException {
Review Comment:
What about making `GravitinoRuntimeException` as the parent class?
--
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]