zzzk1 commented on code in PR #6540: URL: https://github.com/apache/gravitino/pull/6540#discussion_r1976615824
########## core/src/main/java/org/apache/gravitino/storage/relational/mapper/provider/base/CatalogMetaBaseSQLProvider.java: ########## @@ -22,10 +22,57 @@ import static org.apache.gravitino.storage.relational.mapper.CatalogMetaMapper.TABLE_NAME; import java.util.List; +import org.apache.gravitino.storage.relational.mapper.MetalakeMetaMapper; +import org.apache.gravitino.storage.relational.mapper.SchemaMetaMapper; import org.apache.gravitino.storage.relational.po.CatalogPO; import org.apache.ibatis.annotations.Param; public class CatalogMetaBaseSQLProvider { + public String listCatalogPOsByMetalakeName(@Param("metalakeName") String metalakeName) { + return "SELECT cm.catalog_id as catalogId, cm.catalog_name as catalogName," + + " cm.metalake_id as metalakeId, cm.type, cm.provider," + + " cm.catalog_comment as catalogComment, cm.properties, cm.audit_info as auditInfo," + + " cm.current_version as currentVersion, cm.last_version as lastVersion," + + " cm.deleted_at as deletedAt" + + " FROM " + + TABLE_NAME + + " cm JOIN " + + MetalakeMetaMapper.TABLE_NAME + + " mm ON cm.metalake_id = mm.metalake_id" + + " WHERE mm.metalake_name = #{metalakeName}" + + " AND mm.deleted_at = 0 AND cm.deleted_at = 0"; + } + + public String listCatalogPOsByCatalogName(@Param("catalogName") String catalogName) { Review Comment: > @zzzk1 Could you verify if any unit tests cover your changes and add some UTs if there are none? It can actually be covered by existing tests (service), but I have added fine-grained unit tests (mapper). -- 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: commits-unsubscr...@gravitino.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org