rdblue commented on code in PR #18060:
URL: https://github.com/apache/iceberg/pull/18060#discussion_r4039540484


##########
core/src/test/java/org/apache/iceberg/TestFieldStatsStruct.java:
##########
@@ -321,6 +327,12 @@ public void geoSerialization(Type geoType, 
RoundTripSerializer<FieldStatsStruct<
     // readers reuse bounding boxes across entries, so the bounds must be 
deep-copied
     assertThat(copy.lowerBound()).isNotSameAs(lowerBound);
     assertThat(copy.upperBound()).isNotSameAs(upperBound);
+
+    // the reader mutates the reused box for the next row but the copied entry 
must keep its own box
+    lowerBound.set(0, 11.0d);
+    upperBound.set(0, 15.0d);
+    assertBoundingBox(copy.lowerBound(), 1.0d, 2.0d, 3.0d, 4.0d);
+    assertBoundingBox(copy.upperBound(), 5.0d, 6.0d, 7.0d, 8.0d);

Review Comment:
   Why is this needed, instead of relying on the assertions just above that 
`copy.lowerBound()` is not the same as the original?



-- 
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]

Reply via email to