You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@paimon.apache.org by lz...@apache.org on 2025/03/31 10:48:58 UTC
(paimon) branch master updated: [core] Optimize equals and hashCode implementation in Snapshot (#5375)
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 <11...@qq.com>
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. */