pub struct TableMetadata {
Show 19 fields pub format_version: FormatVersion, pub table_uuid: Uuid, pub location: String, pub last_sequence_number: i64, pub last_updated_ms: i64, pub last_column_id: i32, pub schemas: HashMap<i32, Schema>, pub current_schema_id: i32, pub partition_specs: HashMap<i32, PartitionSpec>, pub default_spec_id: i32, pub last_partition_id: i32, pub properties: HashMap<String, String>, pub current_snapshot_id: Option<i64>, pub snapshots: HashMap<i64, Snapshot>, pub snapshot_log: Vec<SnapshotLog>, pub metadata_log: Vec<MetadataLog>, pub sort_orders: HashMap<i32, SortOrder>, pub default_sort_order_id: i32, pub refs: HashMap<String, SnapshotReference>,
}
Expand description

Fields for the version 2 of the table metadata.

Fields§

§format_version: FormatVersion

Integer Version for the format.

§table_uuid: Uuid

A UUID that identifies the table

§location: String

Location tables base location

§last_sequence_number: i64

The tables highest sequence number

§last_updated_ms: i64

Timestamp in milliseconds from the unix epoch when the table was last updated.

§last_column_id: i32

An integer; the highest assigned column ID for the table.

§schemas: HashMap<i32, Schema>

A list of schemas, stored as objects with schema-id.

§current_schema_id: i32

ID of the table’s current schema.

§partition_specs: HashMap<i32, PartitionSpec>

A list of partition specs, stored as full partition spec objects.

§default_spec_id: i32

ID of the “current” spec that writers should use by default.

§last_partition_id: i32

An integer; the highest assigned partition field ID across all partition specs for the table.

§properties: HashMap<String, String>

A string to string map of table properties. This is used to control settings that affect reading and writing and is not intended to be used for arbitrary metadata. For example, commit.retry.num-retries is used to control the number of commit retries.

§current_snapshot_id: Option<i64>

long ID of the current table snapshot; must be the same as the current ID of the main branch in refs.

§snapshots: HashMap<i64, Snapshot>

A list of valid snapshots. Valid snapshots are snapshots for which all data files exist in the file system. A data file must not be deleted from the file system until the last snapshot in which it was listed is garbage collected.

§snapshot_log: Vec<SnapshotLog>

A list (optional) of timestamp and snapshot ID pairs that encodes changes to the current snapshot for the table. Each time the current-snapshot-id is changed, a new entry should be added with the last-updated-ms and the new current-snapshot-id. When snapshots are expired from the list of valid snapshots, all entries before a snapshot that has expired should be removed.

§metadata_log: Vec<MetadataLog>

A list (optional) of timestamp and metadata file location pairs that encodes changes to the previous metadata files for the table. Each time a new metadata file is created, a new entry of the previous metadata file location should be added to the list. Tables can be configured to remove oldest metadata log entries and keep a fixed-size log of the most recent entries after a commit.

§sort_orders: HashMap<i32, SortOrder>

A list of sort orders, stored as full sort order objects.

§default_sort_order_id: i32

Default sort order id of the table. Note that this could be used by writers, but is not used when reading because reads use the specs stored in manifest files.

§refs: HashMap<String, SnapshotReference>

A map of snapshot references. The map keys are the unique snapshot reference names in the table, and the map values are snapshot reference objects. There is always a main branch reference pointing to the current-snapshot-id even if the refs map is null.

Implementations§

source§

impl TableMetadata

source

pub fn current_schema(&self, branch: Option<&str>) -> Result<&Schema, Error>

Get current schema

source

pub fn schema(&self, snapshot_id: i64) -> Result<&Schema, Error>

Get schema for snapshot

source

pub fn default_partition_spec(&self) -> Result<&PartitionSpec, Error>

Get default partition spec

source

pub fn current_snapshot( &self, snapshot_ref: Option<&str> ) -> Result<Option<&Snapshot>, Error>

Get current snapshot

source

pub fn current_snapshot_mut( &mut self, snapshot_ref: Option<String> ) -> Result<Option<&mut Snapshot>, Error>

Get current snapshot

Trait Implementations§

source§

impl Clone for TableMetadata

source§

fn clone(&self) -> TableMetadata

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for TableMetadata

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for TableMetadata

source§

fn default() -> TableMetadata

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for TableMetadata

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<TableMetadata, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<'a> From<&'a TableMetadata> for TabularMetadataRef<'a>

source§

fn from(value: &'a TableMetadata) -> TabularMetadataRef<'a>

Converts to this type from the input type.
source§

impl From<TableMetadata> for TabularMetadata

source§

fn from(value: TableMetadata) -> TabularMetadata

Converts to this type from the input type.
source§

impl PartialEq for TableMetadata

source§

fn eq(&self, other: &TableMetadata) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for TableMetadata

source§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<TableMetadataEnum> for TableMetadata

§

type Error = Error

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

fn try_from(value: TableMetadataEnum) -> Result<TableMetadata, Error>

Performs the conversion.
source§

impl TryFrom<TableMetadataV1> for TableMetadata

§

type Error = Error

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

fn try_from(value: TableMetadataV1) -> Result<TableMetadata, Error>

Performs the conversion.
source§

impl TryFrom<TableMetadataV2> for TableMetadata

§

type Error = Error

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

fn try_from(value: TableMetadataV2) -> Result<TableMetadata, Error>

Performs the conversion.
source§

impl Eq for TableMetadata

source§

impl StructuralPartialEq for TableMetadata

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,