Skip to content
Open
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ public abstract class SerializableTableSpec implements Serializable {
@SchemaFieldNumber("11")
public abstract List<String> getEncryptedKeyJsons();

@SchemaFieldNumber("12")
public abstract long getLastUpdatedMillis();

private transient volatile @MonotonicNonNull Map<Integer, Schema> cachedSchemas;
private transient volatile @MonotonicNonNull Map<Integer, PartitionSpec> cachedPartitionSpecs;
private transient volatile @MonotonicNonNull Map<Integer, SortOrder> cachedSortOrders;
Expand Down Expand Up @@ -285,6 +288,8 @@ public abstract static class Builder {

public abstract Builder setEncryptedKeyJsons(List<String> encryptedKeyJsons);

public abstract Builder setLastUpdatedMillis(long lastUpdatedMillis);

@SchemaIgnore
public Builder setFileIO(FileIO fileIO) {
return setFileIoJson(FileIOParser.toJson(fileIO));
Expand Down Expand Up @@ -324,6 +329,7 @@ public static SerializableTableSpec fromTable(String tableIdentifierString, Tabl
}

TableMetadata metadata = ((HasTableOperations) table).operations().current();
long lastUpdatedMillis = metadata != null ? metadata.lastUpdatedMillis() : 0L;
List<String> encryptedKeyJsons = Collections.emptyList();
if (metadata != null && metadata.encryptionKeys() != null) {
encryptedKeyJsons =
Expand Down Expand Up @@ -360,6 +366,7 @@ public static SerializableTableSpec fromTable(String tableIdentifierString, Tabl
.setProperties(table.properties())
.setFileIoJson(FileIOParser.toJson(table.io()))
.setEncryptedKeyJsons(encryptedKeyJsons)
.setLastUpdatedMillis(lastUpdatedMillis)
.build();
}

Expand Down
Loading
Loading