psvri commented on code in PR #15906:
URL: https://github.com/apache/iceberg/pull/15906#discussion_r3105567545
##########
data/src/test/java/org/apache/iceberg/data/BaseFormatModelTests.java:
##########
@@ -702,21 +699,79 @@ void testDataWriterMetricsWithCountsMode(FileFormat
fileFormat) throws IOExcepti
schema,
PartitionSpec.unpartitioned(),
3,
- ImmutableMap.of(TableProperties.DEFAULT_WRITE_METRICS_MODE,
"counts"));
+ ImmutableMap.of(
+ TableProperties.DEFAULT_WRITE_METRICS_MODE,
MetricsModes.Counts.get().toString()));
MetricsConfig countsConfig = MetricsConfig.forTable(table);
List<Record> genericRecords = dataGenerator.generateRecords();
DataFile dataFile = writeGenericRecords(fileFormat, schema,
genericRecords, countsConfig);
- assertThat(dataFile).isNotNull();
- assertThat(dataFile.recordCount()).isEqualTo(genericRecords.size());
-
// In the counts mode, valueCounts and nullValueCounts should be present,
while lowerBounds and
// upperBounds should be null.
- assertValueAndNullCounts(
- fileFormat, schema, genericRecords, dataFile.valueCounts(),
dataFile.nullValueCounts());
- assertBoundsNull(fileFormat, schema, dataFile.lowerBounds(),
dataFile.upperBounds());
+ assertCounts(fileFormat, schema, genericRecords, dataFile);
+ assertBoundsNull(schema, dataFile);
+ assertColumnSize(fileFormat, dataFile);
+ }
+
+ @ParameterizedTest
+ @FieldSource("FILE_FORMATS")
+ void testDataWriterMetricsWithTruncateMode(FileFormat fileFormat) throws
IOException {
+ int truncateLength = 5;
+ Schema schema =
+ new Schema(
+ Types.NestedField.required(1, "col_str", Types.StringType.get()),
Review Comment:
Truncate mode is applicable to binary type as well. We should add it to the
schema ?
--
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]