Package org.apache.iceberg
Class TableMetadata
- java.lang.Object
-
- org.apache.iceberg.TableMetadata
-
- All Implemented Interfaces:
java.io.Serializable
public class TableMetadata extends java.lang.Object implements java.io.Serializable
Metadata for a table.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TableMetadata.Builder
static class
TableMetadata.MetadataLogEntry
static class
TableMetadata.SnapshotLogEntry
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TableMetadata
addPartitionSpec(PartitionSpec newPartitionSpec)
static TableMetadata.Builder
buildFrom(TableMetadata base)
static TableMetadata.Builder
buildFromEmpty()
static TableMetadata.Builder
buildFromEmpty(int formatVersion)
TableMetadata
buildReplacement(Schema updatedSchema, PartitionSpec updatedPartitionSpec, SortOrder updatedSortOrder, java.lang.String newLocation, java.util.Map<java.lang.String,java.lang.String> updatedProperties)
java.util.List<MetadataUpdate>
changes()
int
currentSchemaId()
Snapshot
currentSnapshot()
int
defaultSortOrderId()
int
defaultSpecId()
int
formatVersion()
int
lastAssignedPartitionId()
int
lastColumnId()
long
lastSequenceNumber()
long
lastUpdatedMillis()
java.lang.String
location()
java.lang.String
metadataFileLocation()
static TableMetadata
newTableMetadata(Schema schema, PartitionSpec spec, java.lang.String location, java.util.Map<java.lang.String,java.lang.String> properties)
static TableMetadata
newTableMetadata(Schema schema, PartitionSpec spec, SortOrder sortOrder, java.lang.String location, java.util.Map<java.lang.String,java.lang.String> properties)
long
nextSequenceNumber()
java.util.List<PartitionStatisticsFile>
partitionStatisticsFiles()
java.util.List<TableMetadata.MetadataLogEntry>
previousFiles()
java.util.Map<java.lang.String,java.lang.String>
properties()
java.lang.String
property(java.lang.String property, java.lang.String defaultValue)
boolean
propertyAsBoolean(java.lang.String property, boolean defaultValue)
int
propertyAsInt(java.lang.String property, int defaultValue)
long
propertyAsLong(java.lang.String property, long defaultValue)
SnapshotRef
ref(java.lang.String name)
java.util.Map<java.lang.String,SnapshotRef>
refs()
TableMetadata
removeSnapshotsIf(java.util.function.Predicate<Snapshot> removeIf)
TableMetadata
replaceProperties(java.util.Map<java.lang.String,java.lang.String> rawProperties)
TableMetadata
replaceSortOrder(SortOrder newOrder)
Schema
schema()
java.util.List<Schema>
schemas()
java.util.Map<java.lang.Integer,Schema>
schemasById()
Snapshot
snapshot(long snapshotId)
java.util.List<HistoryEntry>
snapshotLog()
java.util.List<Snapshot>
snapshots()
SortOrder
sortOrder()
java.util.List<SortOrder>
sortOrders()
java.util.Map<java.lang.Integer,SortOrder>
sortOrdersById()
PartitionSpec
spec()
PartitionSpec
spec(int id)
java.util.List<PartitionSpec>
specs()
java.util.Map<java.lang.Integer,PartitionSpec>
specsById()
java.util.List<StatisticsFile>
statisticsFiles()
TableMetadata
updateLocation(java.lang.String newLocation)
TableMetadata
updatePartitionSpec(PartitionSpec newPartitionSpec)
TableMetadata
updateSchema(Schema newSchema, int newLastColumnId)
TableMetadata
upgradeToFormatVersion(int newFormatVersion)
java.lang.String
uuid()
TableMetadata
withUUID()
-
-
-
Method Detail
-
newTableMetadata
public static TableMetadata newTableMetadata(Schema schema, PartitionSpec spec, SortOrder sortOrder, java.lang.String location, java.util.Map<java.lang.String,java.lang.String> properties)
-
newTableMetadata
public static TableMetadata newTableMetadata(Schema schema, PartitionSpec spec, java.lang.String location, java.util.Map<java.lang.String,java.lang.String> properties)
-
formatVersion
public int formatVersion()
-
metadataFileLocation
public java.lang.String metadataFileLocation()
-
uuid
public java.lang.String uuid()
-
lastSequenceNumber
public long lastSequenceNumber()
-
nextSequenceNumber
public long nextSequenceNumber()
-
lastUpdatedMillis
public long lastUpdatedMillis()
-
lastColumnId
public int lastColumnId()
-
schema
public Schema schema()
-
schemas
public java.util.List<Schema> schemas()
-
schemasById
public java.util.Map<java.lang.Integer,Schema> schemasById()
-
currentSchemaId
public int currentSchemaId()
-
spec
public PartitionSpec spec()
-
spec
public PartitionSpec spec(int id)
-
specs
public java.util.List<PartitionSpec> specs()
-
specsById
public java.util.Map<java.lang.Integer,PartitionSpec> specsById()
-
lastAssignedPartitionId
public int lastAssignedPartitionId()
-
defaultSpecId
public int defaultSpecId()
-
defaultSortOrderId
public int defaultSortOrderId()
-
sortOrder
public SortOrder sortOrder()
-
sortOrders
public java.util.List<SortOrder> sortOrders()
-
sortOrdersById
public java.util.Map<java.lang.Integer,SortOrder> sortOrdersById()
-
location
public java.lang.String location()
-
properties
public java.util.Map<java.lang.String,java.lang.String> properties()
-
property
public java.lang.String property(java.lang.String property, java.lang.String defaultValue)
-
propertyAsBoolean
public boolean propertyAsBoolean(java.lang.String property, boolean defaultValue)
-
propertyAsInt
public int propertyAsInt(java.lang.String property, int defaultValue)
-
propertyAsLong
public long propertyAsLong(java.lang.String property, long defaultValue)
-
snapshot
public Snapshot snapshot(long snapshotId)
-
currentSnapshot
public Snapshot currentSnapshot()
-
snapshots
public java.util.List<Snapshot> snapshots()
-
ref
public SnapshotRef ref(java.lang.String name)
-
refs
public java.util.Map<java.lang.String,SnapshotRef> refs()
-
statisticsFiles
public java.util.List<StatisticsFile> statisticsFiles()
-
partitionStatisticsFiles
public java.util.List<PartitionStatisticsFile> partitionStatisticsFiles()
-
snapshotLog
public java.util.List<HistoryEntry> snapshotLog()
-
previousFiles
public java.util.List<TableMetadata.MetadataLogEntry> previousFiles()
-
changes
public java.util.List<MetadataUpdate> changes()
-
withUUID
public TableMetadata withUUID()
-
updateSchema
public TableMetadata updateSchema(Schema newSchema, int newLastColumnId)
-
updatePartitionSpec
public TableMetadata updatePartitionSpec(PartitionSpec newPartitionSpec)
-
addPartitionSpec
public TableMetadata addPartitionSpec(PartitionSpec newPartitionSpec)
-
replaceSortOrder
public TableMetadata replaceSortOrder(SortOrder newOrder)
-
removeSnapshotsIf
public TableMetadata removeSnapshotsIf(java.util.function.Predicate<Snapshot> removeIf)
-
replaceProperties
public TableMetadata replaceProperties(java.util.Map<java.lang.String,java.lang.String> rawProperties)
-
buildReplacement
public TableMetadata buildReplacement(Schema updatedSchema, PartitionSpec updatedPartitionSpec, SortOrder updatedSortOrder, java.lang.String newLocation, java.util.Map<java.lang.String,java.lang.String> updatedProperties)
-
updateLocation
public TableMetadata updateLocation(java.lang.String newLocation)
-
upgradeToFormatVersion
public TableMetadata upgradeToFormatVersion(int newFormatVersion)
-
buildFrom
public static TableMetadata.Builder buildFrom(TableMetadata base)
-
buildFromEmpty
public static TableMetadata.Builder buildFromEmpty()
-
buildFromEmpty
public static TableMetadata.Builder buildFromEmpty(int formatVersion)
-
-