pub struct Contract {Show 16 fields
pub time_column: Option<String>,
pub series_key: Vec<String>,
pub chunk: Option<Chunk>,
pub dedup: bool,
pub retention: Option<Duration>,
pub target_file_size: u64,
pub row_group_rows: usize,
pub auto_maintain: bool,
pub snapshot_retention: Duration,
pub min_snapshots: usize,
pub max_snapshots: usize,
pub compact_min_files: usize,
pub head_format: String,
pub head_inline_bytes: u64,
pub format_version: FormatVersion,
pub keep_snapshots_until: Option<i64>,
}Expand description
The parsed contract of an existing table.
Fields§
§time_column: Option<String>The timestamp column, if this is a time-series table.
series_key: Vec<String>Columns that identify a series.
chunk: Option<Chunk>Time partition size.
dedup: boolRemove rows with the same (series_key, time) during compaction; the latest write wins.
retention: Option<Duration>Partitions entirely older than this are dropped by maintenance.
target_file_size: u64Compaction writes files of about this size.
row_group_rows: usizeRows per Parquet row group.
auto_maintain: boolAppends run inline maintenance when thresholds are crossed.
snapshot_retention: DurationSnapshots younger than this are kept.
min_snapshots: usizeThe newest snapshots kept regardless of age.
max_snapshots: usizeSnapshots beyond the newest max_snapshots are expired even if younger than the retention.
compact_min_files: usizeInline auto-maintenance merges a size tier of a partition once it has this many files.
head_format: StringFormat of the head object, or none to not write one.
head_inline_bytes: u64Bytes the head may spend on optional sections (the last-value index).
format_version: FormatVersionThe table format version (see crate::FORMAT_VERSION).
keep_snapshots_until: Option<i64>No snapshot expires before this time (milliseconds since the epoch).
Implementations§
Source§impl Contract
impl Contract
Sourcepub fn from_properties(properties: &HashMap<String, String>) -> Result<Self>
pub fn from_properties(properties: &HashMap<String, String>) -> Result<Self>
Reads the contract from Iceberg table properties, with defaults for what isn’t set.
Sourcepub fn check_readable(&self) -> Result<()>
pub fn check_readable(&self) -> Result<()>
Errors when this Timelake can’t read the table correctly: its format is newer than
FORMAT_VERSION in a way that breaks older readers.
Sourcepub fn check_writable(&self) -> Result<()>
pub fn check_writable(&self) -> Result<()>
Errors when this Timelake must not write to the table: it wouldn’t keep what the table’s newer format relies on.
Sourcepub fn is_time_series(&self) -> bool
pub fn is_time_series(&self) -> bool
Whether the table has a time column.
Sourcepub fn sort_columns(&self) -> Vec<String>
pub fn sort_columns(&self) -> Vec<String>
Sort key: series key columns, then time.