From fb642d022701aa1db529e17f09d622b42689c899 Mon Sep 17 00:00:00 2001 From: Qi Chen Date: Wed, 3 Jul 2024 11:09:46 +0800 Subject: [PATCH] [Fix](hive-writer) Fixed the issue where `uncompletedMpuPendingUploads` did not remove objects correctly. (#37173) Backport #36905. --- .../doris/datasource/hive/HMSTransaction.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSTransaction.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSTransaction.java index 824af6996a..d883b9dc78 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSTransaction.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSTransaction.java @@ -103,6 +103,24 @@ public class HMSTransaction implements Transaction { this.s3MPUPendingUpload = s3MPUPendingUpload; this.path = path; } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UncompletedMpuPendingUpload that = (UncompletedMpuPendingUpload) o; + return Objects.equals(s3MPUPendingUpload, that.s3MPUPendingUpload) && Objects.equals(path, + that.path); + } + + @Override + public int hashCode() { + return Objects.hash(s3MPUPendingUpload, path); + } } private Set uncompletedMpuPendingUploads = new HashSet<>();