yuqi1129 commented on code in PR #6393:
URL: https://github.com/apache/gravitino/pull/6393#discussion_r1942420400


##########
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:
   The current logic does not depend on the sequence of `deleted_at` as all 
will be removed by repeatedly calling the method above several times.
   
   Anyway, your suggestion is an improvement. I'm not sure if we need to do it 
in this PR as this one only targets syntax problems. 



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

Reply via email to