mchades commented on code in PR #6393: URL: https://github.com/apache/gravitino/pull/6393#discussion_r1942413280
########## core/src/main/java/org/apache/gravitino/storage/relational/mapper/provider/postgresql/CatalogMetaPostgreSQLProvider.java: ########## @@ -43,6 +43,16 @@ public String softDeleteCatalogMetasByMetalakeId(Long metalakeId) { + " WHERE metalake_id = #{metalakeId} AND deleted_at = 0"; } + @Override + public String deleteCatalogMetasByLegacyTimeline( + @Param("legacyTimeline") Long legacyTimeline, @Param("limit") int limit) { + return "DELETE FROM " + + TABLE_NAME + + " WHERE catalog_id IN (SELECT catalog_id FROM " + + TABLE_NAME + + " WHERE deleted_at > 0 AND deleted_at < #{legacyTimeline} LIMIT #{limit})"; Review Comment: Shouldn't you consider sorting by `deleted_at` in order to clean up the catalog based on the time of deletion? -- 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