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

lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git


The following commit(s) were added to refs/heads/master by this push:
     new 7553bbec89 [core] Optimize equals and hashCode implementation in 
Snapshot (#5375)
7553bbec89 is described below

commit 7553bbec89724ea550c11283e77abb2c83968219
Author: nivane <[email protected]>
AuthorDate: Mon Mar 31 18:48:53 2025 +0800

    [core] Optimize equals and hashCode implementation in Snapshot (#5375)
---
 paimon-core/src/main/java/org/apache/paimon/Snapshot.java | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/paimon-core/src/main/java/org/apache/paimon/Snapshot.java 
b/paimon-core/src/main/java/org/apache/paimon/Snapshot.java
index e4daadb925..0a914cc678 100644
--- a/paimon-core/src/main/java/org/apache/paimon/Snapshot.java
+++ b/paimon-core/src/main/java/org/apache/paimon/Snapshot.java
@@ -424,12 +424,16 @@ public class Snapshot implements Serializable {
                 totalRecordCount,
                 deltaRecordCount,
                 changelogRecordCount,
-                watermark);
+                watermark,
+                statistics);
     }
 
     @Override
     public boolean equals(Object o) {
-        if (!(o instanceof Snapshot)) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
             return false;
         }
         Snapshot that = (Snapshot) o;
@@ -451,7 +455,8 @@ public class Snapshot implements Serializable {
                 && Objects.equals(totalRecordCount, that.totalRecordCount)
                 && Objects.equals(deltaRecordCount, that.deltaRecordCount)
                 && Objects.equals(changelogRecordCount, 
that.changelogRecordCount)
-                && Objects.equals(watermark, that.watermark);
+                && Objects.equals(watermark, that.watermark)
+                && Objects.equals(statistics, that.statistics);
     }
 
     /** Type of changes in this snapshot. */

Reply via email to