rdblue commented on code in PR #18060:
URL: https://github.com/apache/iceberg/pull/18060#discussion_r4039583404
##########
core/src/test/java/org/apache/iceberg/TestContentStatsStruct.java:
##########
@@ -184,6 +184,28 @@ public void copy() {
assertThat(copy.statsFor(3)).isNull();
}
+ @Test
+ @SuppressWarnings("unchecked")
+ public void copyWithNullFieldStats() {
+ FieldStats<Long> idStats = Mockito.mock(FieldStats.class);
+ FieldStats<Long> idStatsCopy = Mockito.mock(FieldStats.class);
+ Mockito.when(idStats.fieldId()).thenReturn(1);
+ Mockito.when(idStats.copy()).thenReturn(idStatsCopy);
+
+ ContentStatsStruct stats = new ContentStatsStruct(CONTENT_STATS_STRUCT);
+ stats.setStats(1, idStats);
+ // when a manifest has no stats for a projected column, the reader leaves
that column's
+ // stats null via set(pos, null), so the copy path must tolerate a null
entry
Review Comment:
I think this comment is unnecessary. It is already clear.
--
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]