jeesou commented on code in PR #11035:
URL: https://github.com/apache/iceberg/pull/11035#discussion_r1802349064


##########
spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/source/TestSparkScan.java:
##########
@@ -911,9 +1027,17 @@ private void checkColStatisticsReported(
     assertThat(stats.numRows().getAsLong()).isEqualTo(expectedRowCount);
 
     Map<NamedReference, ColumnStatistics> columnStats = stats.columnStats();
-    for (Map.Entry<String, Long> entry : expectedNDVs.entrySet()) {
-      
assertThat(columnStats.get(FieldReference.column(entry.getKey())).distinctCount().getAsLong())
-          .isEqualTo(entry.getValue());
+    if (expectedNDVs.isEmpty()) {
+      assertThat(
+              columnStats.isEmpty()
+                  || 
columnStats.values().iterator().next().distinctCount().isEmpty())

Review Comment:
   Hi @RussellSpitzer the check will not work like this, if we do 
columnStats.values().distinctCount, it will give error as "Cannot resolve 
method 'distinctCount' in 'Collection'"



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to