jerryshao commented on code in PR #9430:
URL: https://github.com/apache/gravitino/pull/9430#discussion_r2659458820


##########
core/src/main/java/org/apache/gravitino/storage/relational/mapper/provider/base/ModelMetaBaseSQLProvider.java:
##########
@@ -67,6 +70,46 @@ public String listModelPOsBySchemaId(@Param("schemaId") Long 
schemaId) {
         + " WHERE schema_id = #{schemaId} AND deleted_at = 0";
   }
 
+  public String listModelPOsByFullQualifiedName(
+      @Param("metalakeName") String metalakeName,
+      @Param("catalogName") String catalogName,
+      @Param("schemaName") String schemaName) {
+    return """
+        SELECT
+            mmm.metalake_id AS metalakeId,
+            cm.catalog_id AS catalogId,
+            sm.schema_id AS schemaId,
+            mm.model_id AS modelId,
+            mm.model_name AS modelName,
+            mm.model_comment AS modelComment,
+            mm.model_properties AS modelProperties,
+            mm.model_latest_version AS modelLatestVersion,
+            mm.audit_info AS auditInfo,
+            mm.deleted_at AS deletedAt
+        FROM
+            %s mmm
+        INNER JOIN
+            %s cm ON mmm.metalake_id = cm.metalake_id
+            AND cm.catalog_name = #{catalogName}
+            AND cm.deleted_at = 0
+        LEFT JOIN
+            %s sm ON cm.catalog_id = sm.catalog_id
+            AND sm.schema_name = #{schemaName}
+            AND sm.deleted_at = 0
+        LEFT JOIN
+            %s mm ON sm.schema_id = mm.schema_id
+            AND mm.deleted_at = 0
+        WHERE
+            mmm.metalake_name = #{metalakeName}
+            AND mmm.deleted_at = 0;
+            """
+        .formatted(
+            MetalakeMetaMapper.TABLE_NAME,

Review Comment:
   I would suggest you use a better short name for metalake table and others, 
you use `mm` for metalake table, but here is `mmm`, this is misleading and hard 
to understand.



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