huan233usc commented on code in PR #17451:
URL: https://github.com/apache/iceberg/pull/17451#discussion_r3865479231


##########
core/src/test/java/org/apache/iceberg/StatsTestUtil.java:
##########
@@ -207,6 +220,8 @@ static FieldStats<Object> mockFieldStats(
       Mockito.when(stats.nanValueCount()).thenReturn(nanCount);
     }
 
+    Mockito.when(stats.avgValueSizeInBytes()).thenReturn(avgValueSize);

Review Comment:
   Reverted this one — unlike the counts, `avgValueSizeInBytes()` has no 
`has…()` gate, so `ContentStatsBackedMap` uses `avgValueSizeInBytes() != null` 
as the presence check. A Mockito mock defaults the method to `0` (not null), so 
guarding the stub makes an absent stat read back as present-with-`0` and fails 
`TestTrackedFileAdapters.dataFileAdapterDelegation`/`equalityDeleteFileAdapterDelegation`.
 Kept the unconditional stub with a comment noting the reason.



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