Package org.apache.iceberg
Class TableMetadata.Builder
- java.lang.Object
-
- org.apache.iceberg.TableMetadata.Builder
-
- Enclosing class:
- TableMetadata
public static class TableMetadata.Builder extends java.lang.Object
-
-
Method Summary
-
-
-
Method Detail
-
withMetadataLocation
public TableMetadata.Builder withMetadataLocation(java.lang.String newMetadataLocation)
-
assignUUID
public TableMetadata.Builder assignUUID()
-
assignUUID
public TableMetadata.Builder assignUUID(java.lang.String newUuid)
-
upgradeFormatVersion
public TableMetadata.Builder upgradeFormatVersion(int newFormatVersion)
-
setCurrentSchema
public TableMetadata.Builder setCurrentSchema(Schema newSchema, int newLastColumnId)
-
setCurrentSchema
public TableMetadata.Builder setCurrentSchema(int schemaId)
-
addSchema
public TableMetadata.Builder addSchema(Schema schema, int newLastColumnId)
-
setDefaultPartitionSpec
public TableMetadata.Builder setDefaultPartitionSpec(PartitionSpec spec)
-
setDefaultPartitionSpec
public TableMetadata.Builder setDefaultPartitionSpec(int specId)
-
addPartitionSpec
public TableMetadata.Builder addPartitionSpec(UnboundPartitionSpec spec)
-
addPartitionSpec
public TableMetadata.Builder addPartitionSpec(PartitionSpec spec)
-
setDefaultSortOrder
public TableMetadata.Builder setDefaultSortOrder(SortOrder order)
-
setDefaultSortOrder
public TableMetadata.Builder setDefaultSortOrder(int sortOrderId)
-
addSortOrder
public TableMetadata.Builder addSortOrder(UnboundSortOrder order)
-
addSortOrder
public TableMetadata.Builder addSortOrder(SortOrder order)
-
addSnapshot
public TableMetadata.Builder addSnapshot(Snapshot snapshot)
-
setSnapshotsSupplier
public TableMetadata.Builder setSnapshotsSupplier(SerializableSupplier<java.util.List<Snapshot>> snapshotsSupplier)
-
setBranchSnapshot
public TableMetadata.Builder setBranchSnapshot(Snapshot snapshot, java.lang.String branch)
-
setBranchSnapshot
public TableMetadata.Builder setBranchSnapshot(long snapshotId, java.lang.String branch)
-
setRef
public TableMetadata.Builder setRef(java.lang.String name, SnapshotRef ref)
-
removeRef
public TableMetadata.Builder removeRef(java.lang.String name)
-
setStatistics
public TableMetadata.Builder setStatistics(long snapshotId, StatisticsFile statisticsFile)
-
removeStatistics
public TableMetadata.Builder removeStatistics(long snapshotId)
-
suppressHistoricalSnapshots
public TableMetadata.Builder suppressHistoricalSnapshots()
Suppresses snapshots that are historical, removing the metadata for lazy snapshot loading.Note that the snapshots are not considered removed from metadata and no RemoveSnapshot changes are created.
A snapshot is historical if no ref directly references its ID.
- Returns:
- this for method chaining
-
setPartitionStatistics
public TableMetadata.Builder setPartitionStatistics(PartitionStatisticsFile file)
-
removePartitionStatistics
public TableMetadata.Builder removePartitionStatistics(long snapshotId)
-
removeSnapshots
public TableMetadata.Builder removeSnapshots(java.util.List<Snapshot> snapshotsToRemove)
-
removeSnapshots
public TableMetadata.Builder removeSnapshots(java.util.Collection<java.lang.Long> idsToRemove)
-
setProperties
public TableMetadata.Builder setProperties(java.util.Map<java.lang.String,java.lang.String> updated)
-
removeProperties
public TableMetadata.Builder removeProperties(java.util.Set<java.lang.String> removed)
-
setLocation
public TableMetadata.Builder setLocation(java.lang.String newLocation)
-
discardChanges
public TableMetadata.Builder discardChanges()
-
setPreviousFileLocation
public TableMetadata.Builder setPreviousFileLocation(java.lang.String previousFileLocation)
-
build
public TableMetadata build()
-
-