From 83a2e141ab97a24082543b54406992d9332d9730 Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Mon, 19 Sep 2022 20:28:56 +0200 Subject: [PATCH] Serialize statistics inside Table Metadata --- .../main/java/org/apache/iceberg/TableMetadataParser.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/src/main/java/org/apache/iceberg/TableMetadataParser.java b/core/src/main/java/org/apache/iceberg/TableMetadataParser.java index a2c5bcdf243c..34729dca2f1f 100644 --- a/core/src/main/java/org/apache/iceberg/TableMetadataParser.java +++ b/core/src/main/java/org/apache/iceberg/TableMetadataParser.java @@ -154,6 +154,7 @@ public static String toJson(TableMetadata metadata) { } } + @SuppressWarnings("checkstyle:CyclomaticComplexity") public static void toJson(TableMetadata metadata, JsonGenerator generator) throws IOException { generator.writeStartObject(); @@ -225,6 +226,12 @@ public static void toJson(TableMetadata metadata, JsonGenerator generator) throw } generator.writeEndArray(); + generator.writeArrayFieldStart(STATISTICS); + for (StatisticsFile statisticsFile : metadata.statisticsFiles()) { + StatisticsFileParser.toJson(statisticsFile, generator); + } + generator.writeEndArray(); + generator.writeArrayFieldStart(SNAPSHOT_LOG); for (HistoryEntry logEntry : metadata.snapshotLog()) { generator.writeStartObject();