stevenzwu commented on code in PR #17322:
URL: https://github.com/apache/iceberg/pull/17322#discussion_r3648077550
##########
core/src/test/java/org/apache/iceberg/TestTrackedFileAdapters.java:
##########
@@ -67,19 +67,12 @@ class TestTrackedFileAdapters {
optional(1, "id", Types.IntegerType.get()), optional(2, "score",
Types.FloatType.get()));
private static final Types.StructType CONTENT_STATS_TYPE =
StatsUtil.statsReadSchema(TABLE_SCHEMA, ImmutableList.of(1, 2));
- private static final FieldStats<Integer> ID_STATS =
- new FieldStatsStruct<>(
- CONTENT_STATS_TYPE.fieldType("id").asStructType(), 1, 1000, true,
100L, 5L, 0L, null);
- private static final FieldStats<Float> SCORE_STATS =
- new FieldStatsStruct<>(
- CONTENT_STATS_TYPE.fieldType("score").asStructType(),
- 1.0f,
- 100.0f,
- true,
- 100L,
- 10L,
- 3L,
- null);
+ private static final FieldStats<?> ID_STATS =
+ StatsTestUtil.mockFieldStats(
Review Comment:
Not equivalent
* old: `100L, 5L, 0L`
* new: `100L, 5L, null`
it's needed. `id` is an integer, and the previous fixture set `nan=0` on
it. `MetricsUtil.nanValueCounts` hid that by filtering on column type
(FLOAT/DOUBLE only); `ContentStatsBackedMap` decides tracking by presence
(`hasNanValueCount()`), so a forced `0` makes `id` show up in
`nanValueCounts()` -- which a real integer column never does, since its stats
struct has no `nan_value_count` field. The value constructor can't express "no
nan count" (the nan arg is a primitive `long`), so the fixture mocks
`FieldStats` instead.
--
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]