jerryshao commented on code in PR #4019:
URL: https://github.com/apache/gravitino/pull/4019#discussion_r1663836817
##########
core/src/main/java/com/datastrato/gravitino/storage/relational/mapper/TagMetaMapper.java:
##########
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2024 Datastrato Pvt Ltd.
+ * This software is licensed under the Apache License version 2.
+ */
+
+package com.datastrato.gravitino.storage.relational.mapper;
+
+import com.datastrato.gravitino.storage.relational.po.TagPO;
+import java.util.List;
+import org.apache.ibatis.annotations.Delete;
+import org.apache.ibatis.annotations.Insert;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+public interface TagMetaMapper {
+
+ String TAG_TABLE_NAME = "tag_meta";
+
+ @Select(
+ "SELECT tm.tag_id as tagId, 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.deleted_at = 0")
+ List<TagPO> listTagPOsByMetalake(@Param("metalakeName") String metalakeName);
Review Comment:
I would hesitate to do so, it is overkill to put the check in one
transaction. Also, I was thinking about the behavior of the list, for example,
if we're going to list the entities under a non-existent namespace, should it
return an empty list or throw a namespace not exist exception? Both are
reasonable, I need to think a bit about this.
--
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]