Skip to content

Commit

Permalink
fixup! Add statistics information in table snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Sep 9, 2022
1 parent 9179106 commit b8da141
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
package org.apache.iceberg;

import java.io.Serializable;
import java.util.List;
import java.util.Map;
import java.util.Objects;
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public static List<String> statisticsFilesLocations(Table table) {
for (StatisticsFile statisticsFile : table.statisticsFiles()) {
statisticsFilesLocations.add(statisticsFile.path());
}

return statisticsFilesLocations;
}
}
4 changes: 1 addition & 3 deletions core/src/main/java/org/apache/iceberg/SerializableTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<StatisticsFile> statisticsFiles;
private final Map<String, SnapshotRef> refs;

private transient volatile Table lazyTable = null;
Expand All @@ -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();
}

Expand Down Expand Up @@ -241,7 +239,7 @@ public LocationProvider locationProvider() {

@Override
public List<StatisticsFile> statisticsFiles() {
return statisticsFiles;
return lazyTable().statisticsFiles();
}

@Override
Expand Down

0 comments on commit b8da141

Please sign in to comment.