You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by ga...@apache.org on 2026/09/17 02:02:36 UTC
(iceberg) branch main updated: Spark: Fix RemoveDanglingDeleteFilesAction with Kryo (#18130)
This is an automated email from the ASF dual-hosted git repository.
wgtmac pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg.git
The following commit(s) were added to refs/heads/main by this push:
new 181fd98753 Spark: Fix RemoveDanglingDeleteFilesAction with Kryo (#18130)
181fd98753 is described below
commit 181fd987532b51b259c98dcfa04bc7dbf995a60e
Author: Sergei Nikolaev <ki...@gmail.com>
AuthorDate: Thu Sep 17 04:02:27 2026 +0200
Spark: Fix RemoveDanglingDeleteFilesAction with Kryo (#18130)
Signed-off-by: Sergei Nikolaev <ki...@gmail.com>
---
.../actions/RemoveDanglingDeleteFilesAction.java | 58 +++++++++++++++++++++-
.../actions/TestRemoveDanglingDeleteAction.java | 1 +
2 files changed, 57 insertions(+), 2 deletions(-)
diff --git a/core/src/main/java/org/apache/iceberg/actions/RemoveDanglingDeleteFilesAction.java b/core/src/main/java/org/apache/iceberg/actions/RemoveDanglingDeleteFilesAction.java
index 2532b80793..455757309e 100644
--- a/core/src/main/java/org/apache/iceberg/actions/RemoveDanglingDeleteFilesAction.java
+++ b/core/src/main/java/org/apache/iceberg/actions/RemoveDanglingDeleteFilesAction.java
@@ -24,6 +24,7 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.Set;
import java.util.function.BiFunction;
import org.apache.iceberg.DeleteFile;
@@ -201,10 +202,63 @@ public class RemoveDanglingDeleteFilesAction
return ManifestFiles.readDeleteManifest(manifest, io, specsById).select(DELETE_COLUMNS);
}
- public record DeleteFileKey(String location, Long contentOffset, Long contentSizeInBytes)
- implements Serializable {
+ public static final class DeleteFileKey implements Serializable {
+ private final String location;
+ private final Long contentOffset;
+ private final Long contentSizeInBytes;
+
+ public DeleteFileKey(String location, Long contentOffset, Long contentSizeInBytes) {
+ this.location = location;
+ this.contentOffset = contentOffset;
+ this.contentSizeInBytes = contentSizeInBytes;
+ }
+
public DeleteFileKey(DeleteFile file) {
this(file.location(), file.contentOffset(), file.contentSizeInBytes());
}
+
+ public String location() {
+ return location;
+ }
+
+ public Long contentOffset() {
+ return contentOffset;
+ }
+
+ public Long contentSizeInBytes() {
+ return contentSizeInBytes;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (this == other) {
+ return true;
+ }
+
+ return other instanceof DeleteFileKey that
+ && Objects.equals(location, that.location)
+ && Objects.equals(contentOffset, that.contentOffset)
+ && Objects.equals(contentSizeInBytes, that.contentSizeInBytes);
+ }
+
+ @Override
+ public int hashCode() {
+ int result = Objects.hashCode(location);
+ result = 31 * result + Objects.hashCode(contentOffset);
+ result = 31 * result + Objects.hashCode(contentSizeInBytes);
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return "DeleteFileKey{"
+ + "location="
+ + location
+ + ", contentOffset="
+ + contentOffset
+ + ", contentSizeInBytes="
+ + contentSizeInBytes
+ + '}';
+ }
}
}
diff --git a/spark/v4.2/spark/src/test/java/org/apache/iceberg/spark/actions/TestRemoveDanglingDeleteAction.java b/spark/v4.2/spark/src/test/java/org/apache/iceberg/spark/actions/TestRemoveDanglingDeleteAction.java
index 9976311751..3f78bc2027 100644
--- a/spark/v4.2/spark/src/test/java/org/apache/iceberg/spark/actions/TestRemoveDanglingDeleteAction.java
+++ b/spark/v4.2/spark/src/test/java/org/apache/iceberg/spark/actions/TestRemoveDanglingDeleteAction.java
@@ -37,6 +37,7 @@ public class TestRemoveDanglingDeleteAction extends TestRemoveDanglingDeleteFile
SparkSession.builder()
.master("local[2]")
.config("spark.driver.host", InetAddress.getLoopbackAddress().getHostAddress())
+ .config("spark.serializer", "org.apache.spark.serializer.KryoSerializer")
.config(TestBase.DISABLE_UI)
.getOrCreate();
}