snapshots
Operation
¶
Bases: Enum
Describes the operation.
Possible operation values are
- append: Only data files were added and no files were removed.
- replace: Data and delete files were added and removed without changing table data; i.e., compaction, changing the data file format, or relocating data files.
- overwrite: Data and delete files were added and removed in a logical overwrite operation.
- delete: Data files were removed and their contents logically deleted and/or delete files were added to delete rows.
Source code in pyiceberg/table/snapshots.py
Snapshot
¶
Bases: IcebergBaseModel
Source code in pyiceberg/table/snapshots.py
__repr__()
¶
Return the string representation of the Snapshot class.
Source code in pyiceberg/table/snapshots.py
__str__()
¶
Return the string representation of the Snapshot class.
Source code in pyiceberg/table/snapshots.py
Summary
¶
Bases: IcebergBaseModel, Mapping[str, str]
A class that stores the summary information for a Snapshot.
The snapshot summary’s operation field is used by some operations, like snapshot expiration, to skip processing certain snapshots.
Source code in pyiceberg/table/snapshots.py
__eq__(other)
¶
Compare if the summary is equal to another summary.
Source code in pyiceberg/table/snapshots.py
__getitem__(__key)
¶
Return a key as it is a map.
__len__()
¶
__repr__()
¶
Return the string representation of the Summary class.
Source code in pyiceberg/table/snapshots.py
__setitem__(key, value)
¶
ancestors_between(from_snapshot, to_snapshot, table_metadata)
¶
Get the ancestors of and including the given snapshot between the to and from snapshots.
Source code in pyiceberg/table/snapshots.py
ancestors_of(current_snapshot, table_metadata)
¶
Get the ancestors of and including the given snapshot.
Source code in pyiceberg/table/snapshots.py
latest_ancestor_before_timestamp(table_metadata, timestamp_ms)
¶
Find the latest ancestor snapshot whose timestamp is before the provided timestamp.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table_metadata
|
TableMetadata
|
The table metadata for a table |
required |
timestamp_ms
|
int
|
lookup snapshots strictly before this timestamp |
required |
Returns:
| Type | Description |
|---|---|
Snapshot | None
|
The latest ancestor snapshot older than the timestamp, or None if not found. |