diff --git a/core/src/main/java/org/apache/iceberg/DeletionVectorStruct.java b/core/src/main/java/org/apache/iceberg/DeletionVectorStruct.java index 3f5be0756fad..04d23fa33abe 100644 --- a/core/src/main/java/org/apache/iceberg/DeletionVectorStruct.java +++ b/core/src/main/java/org/apache/iceberg/DeletionVectorStruct.java @@ -19,7 +19,6 @@ package org.apache.iceberg; import java.io.Serializable; -import java.util.Objects; import org.apache.iceberg.avro.SupportsIndexProjection; import org.apache.iceberg.relocated.com.google.common.base.MoreObjects; import org.apache.iceberg.relocated.com.google.common.base.Preconditions; @@ -129,26 +128,6 @@ static Builder builder() { return new Builder(); } - @Override - public boolean equals(Object other) { - if (this == other) { - return true; - } else if (!(other instanceof DeletionVectorStruct)) { - return false; - } - - DeletionVectorStruct that = (DeletionVectorStruct) other; - return Objects.equals(location, that.location) - && offset == that.offset - && sizeInBytes == that.sizeInBytes - && cardinality == that.cardinality; - } - - @Override - public int hashCode() { - return Objects.hash(location, offset, sizeInBytes, cardinality); - } - @Override public String toString() { return MoreObjects.toStringHelper(this) diff --git a/core/src/test/java/org/apache/iceberg/TestDeletionVectorStruct.java b/core/src/test/java/org/apache/iceberg/TestDeletionVectorStruct.java index 88f67a77184d..b20a096077f7 100644 --- a/core/src/test/java/org/apache/iceberg/TestDeletionVectorStruct.java +++ b/core/src/test/java/org/apache/iceberg/TestDeletionVectorStruct.java @@ -163,64 +163,6 @@ void builderMissingRequiredFields() { .hasMessage("Missing required value: cardinality"); } - @Test - void dvEquality() { - DeletionVectorStruct dv = - DeletionVectorStruct.builder() - .location("s3://bucket/data/dv.puffin") - .offset(256L) - .sizeInBytes(128L) - .cardinality(42L) - .build(); - - DeletionVectorStruct sameDv = - DeletionVectorStruct.builder() - .location("s3://bucket/data/dv.puffin") - .offset(256L) - .sizeInBytes(128L) - .cardinality(42L) - .build(); - - DeletionVectorStruct dvWithDifferentLocation = - DeletionVectorStruct.builder() - .location("s3://bucket/data/dv2.puffin") - .offset(256L) - .sizeInBytes(128L) - .cardinality(42L) - .build(); - - DeletionVectorStruct dvWithDifferentOffset = - DeletionVectorStruct.builder() - .location("s3://bucket/data/dv.puffin") - .offset(1L) - .sizeInBytes(128L) - .cardinality(42L) - .build(); - - DeletionVectorStruct dvWithDifferentSize = - DeletionVectorStruct.builder() - .location("s3://bucket/data/dv.puffin") - .offset(256L) - .sizeInBytes(8L) - .cardinality(42L) - .build(); - - DeletionVectorStruct dvWithDifferentCardinality = - DeletionVectorStruct.builder() - .location("s3://bucket/data/dv.puffin") - .offset(256L) - .sizeInBytes(128L) - .cardinality(2L) - .build(); - - assertThat(dv).isEqualTo(dv); - assertThat(dv).isEqualTo(sameDv); - assertThat(dv).isNotEqualTo(dvWithDifferentLocation); - assertThat(dv).isNotEqualTo(dvWithDifferentOffset); - assertThat(dv).isNotEqualTo(dvWithDifferentSize); - assertThat(dv).isNotEqualTo(dvWithDifferentCardinality); - } - @Test void builderRejectsInvalidValuesAtSetter() { assertThatThrownBy(() -> DeletionVectorStruct.builder().location(null))