pub struct DesiredTable {
pub table: TableRef,
pub columns: Vec<ColumnSpec>,
pub comment: Option<String>,
pub properties: BTreeMap<String, String>,
}Expand description
The target state the engine wants a table to be in, derived from an incoming
Arrow RecordBatch schema plus contract/engine metadata.
Fields§
§table: TableRefThe table this describes.
columns: Vec<ColumnSpec>Columns in declaration order.
comment: Option<String>Table-level description, if any.
properties: BTreeMap<String, String>Table properties/tags (owner, contract URI + version, source topic, …), stored sorted so a plan is deterministic.
Implementations§
Source§impl DesiredTable
impl DesiredTable
Sourcepub fn new(table: TableRef, columns: Vec<ColumnSpec>) -> Self
pub fn new(table: TableRef, columns: Vec<ColumnSpec>) -> Self
Start a desired-table spec with columns; comment and properties default empty and are added with the builder methods.
Sourcepub fn with_comment(self, comment: impl Into<String>) -> Self
pub fn with_comment(self, comment: impl Into<String>) -> Self
Builder: set the table-level comment.
Sourcepub fn with_property(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_property( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Builder: set a table property/tag.
Sourcepub fn column(&self, name: &str) -> Option<&ColumnSpec>
pub fn column(&self, name: &str) -> Option<&ColumnSpec>
Look up a desired column by name.
Sourcepub fn from_arrow_schema(table: TableRef, schema: &Schema) -> Self
pub fn from_arrow_schema(table: TableRef, schema: &Schema) -> Self
Derive the desired columns directly from an incoming Arrow RecordBatch
schema — the create/evolve driver described in the Zerobus sink plan §5.1.
Each Arrow field maps to the coarse sink type via
[ProtoFieldType::from_arrow_type], carrying the field’s nullability.
Comments and properties are attached afterwards with the builder methods
(they come from the contract / engine, not the Arrow schema).
Trait Implementations§
Source§impl Clone for DesiredTable
impl Clone for DesiredTable
Source§fn clone(&self) -> DesiredTable
fn clone(&self) -> DesiredTable
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more