kennknowles commented on code in PR #33554:
URL: https://github.com/apache/beam/pull/33554#discussion_r1943070952
##########
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())
Review Comment:
Hmmm maybe it was `Objects.hash`. Weird that Autovalue doesn't use it.
Basically, don't calculate a hash yourself but just say
`Objects.hash(field1, field2, field3, ...)` to avoid coming up with your own,
and making the logic very obvious.
--
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]