pub struct Contract {Show 25 fields
pub time_column: Option<String>,
pub series_key: Vec<String>,
pub chunk: Option<Chunk>,
pub dedup: bool,
pub ingest_time_column: Option<String>,
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 compact_cold_after: Option<Duration>,
pub read_dedup: bool,
pub read_dedup_strategy: String,
pub head_format: String,
pub head_inline_bytes: u64,
pub format_version: FormatVersion,
pub keep_snapshots_until: Option<i64>,
pub rollups: Vec<String>,
pub rollup_routing: bool,
pub rollup_refresh_interval: Option<Duration>,
pub version_check_interval: Duration,
pub data_page_rows: Option<usize>,
}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.
ingest_time_column: Option<String>The column holding each row’s insertion time, if the table has one.
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.
compact_cold_after: Option<Duration>Inline auto-maintenance rewrites a partition whole once the table holds data newer than the
partition’s end by this much (None: never).
read_dedup: boolThe Timelake reader removes copies of a (series…, time) when reading.
read_dedup_strategy: StringHow the Timelake reader removes copies: merge or keys-first.
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).
rollups: Vec<String>The table’s rollups (table names).
rollup_routing: boolThe Timelake reader may answer queries on this table from its rollups.
rollup_refresh_interval: Option<Duration>For a rollup: inline maintenance of its raw table refreshes it once its last refresh is this
old (None: never).
version_check_interval: DurationThe Timelake reader uses a table version it loaded or checked for this long before checking for a newer one.
data_page_rows: Option<usize>Rows per Parquet data page in the files written (None: the writer’s default).
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.
Sourcepub fn write_order(&self) -> Vec<String>
pub fn write_order(&self) -> Vec<String>
The sort key, then the insertion time: in this order (ties kept in commit order) the last
row of each (series…, time) is its latest write.