pvary commented on code in PR #15906:
URL: https://github.com/apache/iceberg/pull/15906#discussion_r3110280655
##########
data/src/test/java/org/apache/iceberg/data/BaseFormatModelTests.java:
##########
@@ -628,6 +648,293 @@ 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);
+
+ assertCounts(fileFormat, schema, genericRecords, dataFile);
+ assertBounds(fileFormat, schema, genericRecords, dataFile);
+ assertColumnSize(fileFormat, dataFile);
+ }
+
+ @ParameterizedTest
+ @FieldSource("FILE_FORMATS")
+ void testDataWriterMetricsWithNoneMode(FileFormat fileFormat) throws
IOException {
+ DataGenerator dataGenerator = new DataGenerators.DefaultSchema();
+ Schema schema = dataGenerator.schema();
+
+ TestTables.TestTable table =
+ TestTables.create(
+ tableDir,
+ "test",
+ schema,
+ PartitionSpec.unpartitioned(),
+ 3,
+ ImmutableMap.of(
+ TableProperties.DEFAULT_WRITE_METRICS_MODE,
MetricsModes.None.get().toString()));
+
+ MetricsConfig noneConfig = MetricsConfig.forTable(table);
Review Comment:
Maybe something like this:
```suggestion
config(schema, mode, length, cols);
private MetricsConfig config(Schema schema, MetricsMode mode, int
length, String[] cols) {
TestTables.TestTable table =
TestTables.create(
tableDir,
"test",
schema,
PartitionSpec.unpartitioned(),
3,
[..]
);
return MetricsConfig.forTable(table);
}
```
--
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]