Skip to main content

IcebergMetadata

Struct IcebergMetadata 

Source
pub struct IcebergMetadata {
Show 22 fields pub format_version: i32, pub table_uuid: String, pub location: String, pub last_sequence_number: i64, pub next_row_id: i64, pub last_updated_ms: i64, pub last_column_id: i32, pub schemas: Vec<Value>, pub current_schema_id: i32, pub partition_specs: Vec<Value>, pub default_spec_id: i32, pub last_partition_id: i32, pub properties: HashMap<String, String>, pub current_snapshot_id: Option<SnapshotId>, pub snapshots: Vec<IcebergSnapshot>, pub snapshot_log: Vec<Value>, pub metadata_log: Vec<Value>, pub sort_orders: Vec<Value>, pub default_sort_order_id: i32, pub refs: HashMap<String, Value>, pub statistics: Vec<IcebergStatisticsRef>, pub partition_statistics: Vec<IcebergPartitionStatsRef>,
}

Fields§

§format_version: i32§table_uuid: String§location: String§last_sequence_number: i64§next_row_id: i64

Iceberg V3 Row Lineage: next available globally-unique row ID. Incremented by record_count for each new data file at commit time. Absent (0) in V2 tables — field is ignored when format-version < 3.

§last_updated_ms: i64§last_column_id: i32§schemas: Vec<Value>§current_schema_id: i32§partition_specs: Vec<Value>§default_spec_id: i32§last_partition_id: i32§properties: HashMap<String, String>§current_snapshot_id: Option<SnapshotId>§snapshots: Vec<IcebergSnapshot>§snapshot_log: Vec<Value>§metadata_log: Vec<Value>§sort_orders: Vec<Value>§default_sort_order_id: i32§refs: HashMap<String, Value>§statistics: Vec<IcebergStatisticsRef>

Iceberg V3 statistics files (Puffin). Only written for format-version=3.

§partition_statistics: Vec<IcebergPartitionStatsRef>

Partition statistics files (Parquet). Written for partitioned tables on every commit. Referenced under "partition-statistics" in metadata.json (Iceberg spec §3.6). Enables Spark/Trino to do partition-level aggregations without scanning data files.

Implementations§

Source§

impl IcebergMetadata

Source

pub fn new( location: &str, policy: &VectorStoragePolicy, format_version: u8, partition_column_type: Option<&str>, partition_fields: &[PartitionDef], ) -> Self

Create a new metadata.json for a fresh AI-Lake table.

format_version: 2 = Iceberg V2 (default); 3 = Iceberg V3 opt-in. V3 tables are append/update compatible; equality deletes and partition statistics require future phases (see docs/specs/ICEBERG_V3.md). partition_column_type: Iceberg type of the partition column (“string”, “uuid”, “int”, “long”). Defaults to “string” when None. Only used when policy.partition_by is set.

Source

pub fn to_json(&self) -> AilakeResult<String>

Source

pub fn from_json(s: &str) -> AilakeResult<Self>

Source

pub fn to_table_metadata(&self) -> TableMetadata

Trait Implementations§

Source§

impl Debug for IcebergMetadata

Source§

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

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

impl<'de> Deserialize<'de> for IcebergMetadata

Source§

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

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

impl Serialize for IcebergMetadata

Source§

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

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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

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