Guosmilesmile commented on code in PR #15906:
URL: https://github.com/apache/iceberg/pull/15906#discussion_r3101721461


##########
data/src/test/java/org/apache/iceberg/data/BaseFormatModelTests.java:
##########
@@ -628,6 +644,239 @@ void 
testReaderBuilderRecordsPerBatchNotSupported(FileFormat fileFormat) throws
         .isInstanceOf(UnsupportedOperationException.class);
   }
 
+  @ParameterizedTest
+  @FieldSource("FILE_FORMATS")
+  void testDataWriterMetricsCollection(FileFormat fileFormat) throws 
IOException {
+    DataGenerator dataGenerator = new DataGenerators.DefaultSchema();
+    Schema schema = dataGenerator.schema();
+
+    List<Record> genericRecords = dataGenerator.generateRecords();
+    DataFile dataFile = writeGenericRecords(fileFormat, schema, 
genericRecords);
+
+    assertThat(dataFile).isNotNull();
+    assertThat(dataFile.recordCount()).isEqualTo(genericRecords.size());
+
+    assertValueAndNullCounts(
+        fileFormat, schema, genericRecords, dataFile.valueCounts(), 
dataFile.nullValueCounts());
+    assertBounds(
+        fileFormat, schema, genericRecords, dataFile.lowerBounds(), 
dataFile.upperBounds());
+
+    assertThat(dataFile.columnSizes()).isNotNull().isNotEmpty();

Review Comment:
   I add to all the UT for check columnSizes is empty or not. 



##########
data/src/test/java/org/apache/iceberg/data/BaseFormatModelTests.java:
##########
@@ -628,6 +644,239 @@ void 
testReaderBuilderRecordsPerBatchNotSupported(FileFormat fileFormat) throws
         .isInstanceOf(UnsupportedOperationException.class);
   }
 
+  @ParameterizedTest
+  @FieldSource("FILE_FORMATS")
+  void testDataWriterMetricsCollection(FileFormat fileFormat) throws 
IOException {
+    DataGenerator dataGenerator = new DataGenerators.DefaultSchema();
+    Schema schema = dataGenerator.schema();
+
+    List<Record> genericRecords = dataGenerator.generateRecords();
+    DataFile dataFile = writeGenericRecords(fileFormat, schema, 
genericRecords);
+
+    assertThat(dataFile).isNotNull();
+    assertThat(dataFile.recordCount()).isEqualTo(genericRecords.size());
+
+    assertValueAndNullCounts(

Review Comment:
   Change to assertCounts.



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