rdblue commented on code in PR #18060:
URL: https://github.com/apache/iceberg/pull/18060#discussion_r4039558373
##########
core/src/test/java/org/apache/iceberg/TestFieldStatsStruct.java:
##########
@@ -294,15 +298,17 @@ public void geoSerialization(Type geoType,
RoundTripSerializer<FieldStatsStruct<
Types.StructType statsStruct =
StatsUtil.fieldStatsStruct(geoType, BASE_ID, MetricsModes.Full.get());
- // geometry and geography use bounding-box structs (x, y, z, m) for their
bounds
+ // geometry and geography use bounding-box structs (x, y, z, m) for their
bounds, and
+ // readers reuse that box across rows, so a reused container must not
carry one entry's box
+ // into the next
PartitionData lowerBound =
- new
PartitionData(statsStruct.field("lower_bound").type().asStructType());
+ new
PartitionData(statsStruct.field(StatsUtil.LOWER_BOUND_NAME).type().asStructType());
Review Comment:
Tests should generally hard-code values instead of sharing constants. I
think that this is less correct than before because the test no longer relies
on a specific name.
Using constants in tests like this can also cause constants to have wider
visibility, so I think it is better to use independent values.
--
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]