Skip to main content

Contract

Struct Contract 

Source
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: bool

Remove 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: u64

Compaction writes files of about this size.

§row_group_rows: usize

Rows per Parquet row group.

§auto_maintain: bool

Appends run inline maintenance when thresholds are crossed.

§snapshot_retention: Duration

Snapshots younger than this are kept.

§min_snapshots: usize

The newest snapshots kept regardless of age.

§max_snapshots: usize

Snapshots beyond the newest max_snapshots are expired even if younger than the retention.

§compact_min_files: usize

Inline auto-maintenance merges a size tier of a partition once it has this many files.

§head_format: String

Format of the head object, or none to not write one.

§head_inline_bytes: u64

Bytes the head may spend on optional sections (the last-value index).

§format_version: FormatVersion

The 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

Source

pub fn from_properties(properties: &HashMap<String, String>) -> Result<Self>

Reads the contract from Iceberg table properties, with defaults for what isn’t set.

Source

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.

Source

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.

Source

pub fn is_time_series(&self) -> bool

Whether the table has a time column.

Source

pub fn sort_columns(&self) -> Vec<String>

Sort key: series key columns, then time.

Trait Implementations§

Source§

impl Clone for Contract

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Contract

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.