yyanyy commented on a change in pull request #1641:
URL: https://github.com/apache/iceberg/pull/1641#discussion_r521733769
##########
File path: core/src/test/java/org/apache/iceberg/TestMetrics.java
##########
@@ -96,67 +97,54 @@
required(13, "timestampColBelowEpoch", TimestampType.withoutZone())
);
+ private static final Schema FLOAT_DOUBLE_ONLY_SCHEMA = new Schema(
+ optional(1, "floatCol", FloatType.get()),
+ optional(2, "doubleCol", DoubleType.get())
+ );
+
private final byte[] fixed = "abcd".getBytes(StandardCharsets.UTF_8);
public abstract FileFormat fileFormat();
- public Metrics getMetrics(InputFile file) {
- return getMetrics(file, MetricsConfig.getDefault());
- }
-
- public abstract Metrics getMetrics(InputFile file, MetricsConfig
metricsConfig);
+ public abstract Metrics getMetrics(Schema schema, MetricsConfig
metricsConfig, Record... records) throws IOException;
- public abstract InputFile writeRecords(Schema schema, Record... records)
throws IOException;
+ public abstract Metrics getMetrics(Schema schema, Record... records) throws
IOException;
Review comment:
I think the main reason for refactoring is that, before this change we
have `writeRecords` to create appender and return `InputFile`, and then in
Parquet specific tests we use `ParquetUtil.fileMetrics` to read metrics from
the file footer of `InputFile` directly. But now since NaN is tracked during
writing, to test NaN we will need to test against `appender.metrics()`.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]