the-other-tim-brown commented on code in PR #1016:
URL: https://github.com/apache/incubator-xtable/pull/1016#discussion_r4728131742
##########
xtable-core/src/main/java/org/apache/xtable/paimon/PaimonStatsExtractor.java:
##########
@@ -46,26 +55,62 @@
public class PaimonStatsExtractor {
private static final PaimonStatsExtractor INSTANCE = new
PaimonStatsExtractor();
+ private static final List<InternalSchema.MetadataValue> TIMESTAMP_PRECISIONS
=
+ Arrays.asList(
+ InternalSchema.MetadataValue.MILLIS,
+ InternalSchema.MetadataValue.MICROS,
+ InternalSchema.MetadataValue.NANOS);
+
+ private final PaimonSchemaExtractor schemaExtractor =
PaimonSchemaExtractor.getInstance();
+
public static PaimonStatsExtractor getInstance() {
return INSTANCE;
}
- public List<ColumnStat> extractColumnStats(DataFileMeta file, InternalSchema
internalSchema) {
+ /**
+ * Maps the columns of the schema data files were written with to the fields
of the schema the
+ * stats are reported in. Columns are matched by field id, since a column
can be renamed, dropped
+ * or added after a file was written. Build it once for each schema id of
the files.
+ *
+ * @param fileSchema the schema the data files were written with, which
their stats are stored in
+ * @param internalSchema the schema to report the stats in
+ * @return the stats layout of the files written with {@code fileSchema}
+ */
+ public StatsLayout getStatsLayout(TableSchema fileSchema, InternalSchema
internalSchema) {
Review Comment:
Lets make this package private
##########
xtable-core/src/main/java/org/apache/xtable/paimon/PaimonStatsExtractor.java:
##########
@@ -187,4 +266,24 @@ private Object getValue(BinaryRow row, int index,
InternalType type, InternalSch
return null;
}
}
+
+ /** The stats layout of the data files written with one schema. */
+ @Value
+ public static class StatsLayout {
Review Comment:
Similarly, make this package private
--
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]