rdblue commented on code in PR #17433:
URL: https://github.com/apache/iceberg/pull/17433#discussion_r3779848119
##########
core/src/test/java/org/apache/iceberg/TestFieldStatsStruct.java:
##########
@@ -317,6 +317,10 @@ public void geoSerialization(Type geoType,
RoundTripSerializer<FieldStatsStruct<
assertThat(copy.fieldId()).isEqualTo(stats.fieldId());
assertThat(copy.type()).isEqualTo(stats.type());
assertThat(comparator.compare(copy, stats)).isEqualTo(0);
+
+ // readers hold copies, so a copied bounding box must survive the same
round trip
+ FieldStatsStruct<?> roundTrippedCopy = serializer.apply(stats.copy());
+ assertThat(comparator.compare(roundTrippedCopy, stats)).isEqualTo(0);
Review Comment:
Isn't this already tested by the case that calls the
`FieldStatsStruct::copy` serializer?
And isn't the intent to test that the copied bound is not the same as the
original? I think you want to check that the copy was deep like this:
```java
assertThat(copy.lowerBound()).isNotSameAs(lowerBound);
assertThat(copy.upperBound()).isNotSameAs(upperBound);
```
Those assertions fail in main.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]