the-other-tim-brown commented on code in PR #767:
URL: https://github.com/apache/incubator-xtable/pull/767#discussion_r2652140362
##########
xtable-core/src/main/java/org/apache/xtable/paimon/PaimonDataFileExtractor.java:
##########
@@ -78,10 +93,154 @@ private String toFullPhysicalPath(FileStoreTable table,
ManifestEntry entry) {
}
}
- private List<ColumnStat> toColumnStats(DataFileMeta file) {
- // TODO: Implement logic to extract column stats from the file meta
- // https://github.com/apache/incubator-xtable/issues/755
- return Collections.emptyList();
+ private List<ColumnStat> toColumnStats(DataFileMeta file, InternalSchema
internalSchema) {
+ List<ColumnStat> columnStats = new ArrayList<>();
+ Map<String, InternalField> fieldMap =
+ internalSchema.getAllFields().stream()
+ .collect(Collectors.toMap(InternalField::getPath, f -> f));
+
+ // stats for all columns are present in valueStats, we can safely ignore
file.keyStats() - TODO: validate this assumption
+ SimpleStats valueStats = file.valueStats();
+ if (valueStats != null) {
+ // log.info("Processing valueStats: {}", valueStats.toRow());
+ List<String> colNames = file.valueStatsCols();
+ // log.info("valueStatsCols: {}", colNames);
+ if (colNames == null || colNames.isEmpty()) {
+ // if column names are not present, we assume all columns in the
schema are present in the same order as the schema - TODO: validate this
assumption
Review Comment:
@mikedias do you know the answers to any of these Paimon questions on this
PR by any chance?
--
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]