wombatu-kun commented on code in PR #17116:
URL: https://github.com/apache/iceberg/pull/17116#discussion_r3533135333
##########
core/src/test/java/org/apache/iceberg/TestMetrics.java:
##########
@@ -865,30 +786,8 @@ protected <T> void assertBounds(
} else {
assertThat(upperBound).isNull();
}
-
- if (null != metricsWithStats.stats()) {
- assertSerializable(metricsWithStats.stats());
- FieldStats<?> stat = metricsWithStats.stats().statsFor(fieldId);
- if (null == stat) {
- // stat is only null when metrics mode is set to none
- assertThat(lowerBound).isNull();
- assertThat(upperBound).isNull();
- } else {
- assertThat(stat).isNotNull();
- if (lowerBound instanceof CharBuffer || upperBound instanceof
CharBuffer) {
- // CharBuffer is stored as String in content stats
- assertThat(stat.lowerBound()).isEqualTo(lowerBound.toString());
- assertThat(stat.upperBound()).isEqualTo(upperBound.toString());
- } else {
- assertThat(stat.lowerBound()).isEqualTo(lowerBound);
- assertThat(stat.upperBound()).isEqualTo(upperBound);
- }
- }
- }
}
- protected record MetricsWithStats(Metrics metrics, ContentStats stats) {}
-
private void assertSerializable(ContentStats stats) {
Review Comment:
`assertSerializable` is now unused - its only callers in
`assertCounts`/`assertBounds` were removed here, and error-prone `UnusedMethod`
is skipped on test sources (`baseline.gradle:90`) so CI won't flag it. It was
also the only test round-tripping a `ContentStats` container through Java
serialization (`TestContentStats` has none; `TestFieldStats` covers only
element-level `FieldStats`), so either drop the method or move that coverage
into `TestContentStats`.
--
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]