From b8da141d61844be47e3823a7872d22c57781167c Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Fri, 9 Sep 2022 10:32:10 +0200 Subject: [PATCH] fixup! Add statistics information in table snapshot --- .../src/main/java/org/apache/iceberg/GenericBlobMetadata.java | 3 +-- .../main/java/org/apache/iceberg/GenericStatisticsFile.java | 3 +-- core/src/main/java/org/apache/iceberg/ReachableFileUtil.java | 1 + core/src/main/java/org/apache/iceberg/SerializableTable.java | 4 +--- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/org/apache/iceberg/GenericBlobMetadata.java b/core/src/main/java/org/apache/iceberg/GenericBlobMetadata.java index 47c601f838f0..46bedfa01753 100644 --- a/core/src/main/java/org/apache/iceberg/GenericBlobMetadata.java +++ b/core/src/main/java/org/apache/iceberg/GenericBlobMetadata.java @@ -18,7 +18,6 @@ */ package org.apache.iceberg; -import java.io.Serializable; import java.util.List; import java.util.Map; import java.util.Objects; @@ -27,7 +26,7 @@ import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList; import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap; -public class GenericBlobMetadata implements BlobMetadata, Serializable { +public class GenericBlobMetadata implements BlobMetadata { public static BlobMetadata from(org.apache.iceberg.puffin.BlobMetadata puffinMetadata) { return new GenericBlobMetadata( diff --git a/core/src/main/java/org/apache/iceberg/GenericStatisticsFile.java b/core/src/main/java/org/apache/iceberg/GenericStatisticsFile.java index 631c179f74b5..2f00138235f3 100644 --- a/core/src/main/java/org/apache/iceberg/GenericStatisticsFile.java +++ b/core/src/main/java/org/apache/iceberg/GenericStatisticsFile.java @@ -18,14 +18,13 @@ */ package org.apache.iceberg; -import java.io.Serializable; import java.util.List; import java.util.Objects; import java.util.StringJoiner; import org.apache.iceberg.relocated.com.google.common.base.Preconditions; import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList; -public class GenericStatisticsFile implements StatisticsFile, Serializable { +public class GenericStatisticsFile implements StatisticsFile { private final long snapshotId; private final String path; private final long fileSizeInBytes; diff --git a/core/src/main/java/org/apache/iceberg/ReachableFileUtil.java b/core/src/main/java/org/apache/iceberg/ReachableFileUtil.java index 6f1193142acd..fdba8e295752 100644 --- a/core/src/main/java/org/apache/iceberg/ReachableFileUtil.java +++ b/core/src/main/java/org/apache/iceberg/ReachableFileUtil.java @@ -125,6 +125,7 @@ public static List statisticsFilesLocations(Table table) { for (StatisticsFile statisticsFile : table.statisticsFiles()) { statisticsFilesLocations.add(statisticsFile.path()); } + return statisticsFilesLocations; } } diff --git a/core/src/main/java/org/apache/iceberg/SerializableTable.java b/core/src/main/java/org/apache/iceberg/SerializableTable.java index 50cfe4831bfb..9b441113e7ab 100644 --- a/core/src/main/java/org/apache/iceberg/SerializableTable.java +++ b/core/src/main/java/org/apache/iceberg/SerializableTable.java @@ -61,7 +61,6 @@ public class SerializableTable implements Table, Serializable { private final FileIO io; private final EncryptionManager encryption; private final LocationProvider locationProvider; - private final List statisticsFiles; private final Map refs; private transient volatile Table lazyTable = null; @@ -83,7 +82,6 @@ protected SerializableTable(Table table) { this.io = fileIO(table); this.encryption = table.encryption(); this.locationProvider = table.locationProvider(); - this.statisticsFiles = table.statisticsFiles(); this.refs = table.refs(); } @@ -241,7 +239,7 @@ public LocationProvider locationProvider() { @Override public List statisticsFiles() { - return statisticsFiles; + return lazyTable().statisticsFiles(); } @Override