ahmedabu98 commented on code in PR #33554:
URL: https://github.com/apache/beam/pull/33554#discussion_r1913413723
##########
sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/SerializableDataFile.java:
##########
@@ -199,4 +203,53 @@ DataFile createDataFile(Map<Integer, PartitionSpec>
partitionSpecs) {
}
return output;
}
+
+ @Override
+ @SuppressWarnings("EqualsHashCode")
+ public final boolean equals(@Nullable Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ SerializableDataFile that = (SerializableDataFile) o;
+ return getPath().equals(that.getPath())
+ && getFileFormat().equals(that.getFileFormat())
+ && getRecordCount() == that.getRecordCount()
+ && getFileSizeInBytes() == that.getFileSizeInBytes()
+ && getPartitionPath().equals(that.getPartitionPath())
+ && getPartitionSpecId() == that.getPartitionSpecId()
+ && Objects.equals(getKeyMetadata(), that.getKeyMetadata())
+ && Objects.equals(getSplitOffsets(), that.getSplitOffsets())
+ && Objects.equals(getColumnSizes(), that.getColumnSizes())
+ && Objects.equals(getValueCounts(), that.getValueCounts())
+ && Objects.equals(getNullValueCounts(), that.getNullValueCounts())
+ && Objects.equals(getNanValueCounts(), that.getNanValueCounts())
+ && mapEquals(getLowerBounds(), that.getLowerBounds())
+ && mapEquals(getUpperBounds(), that.getUpperBounds());
+ }
+
+ private static boolean mapEquals(
+ @Nullable Map<Integer, byte[]> map1, @Nullable Map<Integer, byte[]>
map2) {
Review Comment:
Right, ideally we'd be using ByteBuffer, but that currentl raises other
issues. I saw your comment on the other PR and replied
[here](https://github.com/apache/beam/pull/32821#issuecomment-2587384084).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]