This is an automated email from the ASF dual-hosted git repository.

yuqi4733 pushed a commit to branch branch-1.0
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/branch-1.0 by this push:
     new 55ede92ba2 [#9038] fix(storage): Fix the hard deletion of statistics 
(#9040)
55ede92ba2 is described below

commit 55ede92ba2aa4f9ad013af64598dfbbe2e85063b
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Nov 7 20:20:53 2025 +0800

    [#9038] fix(storage): Fix the hard deletion of statistics (#9040)
    
    ### What changes were proposed in this pull request?
    
    Fix the hard deletion of statistics
    
    ### Why are the changes needed?
    
    Fix: #9308
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    No.
    
    Co-authored-by: roryqi <[email protected]>
---
 .../mapper/provider/postgresql/StatisticPostgresSQLProvider.java | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git 
a/core/src/main/java/org/apache/gravitino/storage/relational/mapper/provider/postgresql/StatisticPostgresSQLProvider.java
 
b/core/src/main/java/org/apache/gravitino/storage/relational/mapper/provider/postgresql/StatisticPostgresSQLProvider.java
index 99ffe93751..2d78baeef1 100644
--- 
a/core/src/main/java/org/apache/gravitino/storage/relational/mapper/provider/postgresql/StatisticPostgresSQLProvider.java
+++ 
b/core/src/main/java/org/apache/gravitino/storage/relational/mapper/provider/postgresql/StatisticPostgresSQLProvider.java
@@ -59,4 +59,13 @@ public class StatisticPostgresSQLProvider extends 
StatisticBaseSQLProvider {
         + "  deleted_at = EXCLUDED.deleted_at"
         + "</script>";
   }
+
+  @Override
+  public String deleteStatisticsByLegacyTimeline(Long legacyTimeline, int 
limit) {
+    return "DELETE FROM "
+        + STATISTIC_META_TABLE_NAME
+        + " WHERE statistic_id IN (SELECT statistic_id FROM "
+        + STATISTIC_META_TABLE_NAME
+        + " WHERE deleted_at > 0 AND deleted_at < #{legacyTimeline} LIMIT 
#{limit})";
+  }
 }

Reply via email to