pub struct SchemaSpec {
pub name: Option<String>,
pub columns: Vec<ColumnSpec>,
}Expand description
A named tabular signature (one input dataset, or the single output). name is optional for
the output; required-and-distinct for multi-input transforms (validated in the manifest).
Fields§
§name: Option<String>§columns: Vec<ColumnSpec>Implementations§
Source§impl SchemaSpec
impl SchemaSpec
Sourcepub fn new(columns: impl IntoIterator<Item = impl Into<ColumnSpec>>) -> Self
pub fn new(columns: impl IntoIterator<Item = impl Into<ColumnSpec>>) -> Self
An unnamed signature from (name, type) pairs or ColumnSpecs.
use fv_compute::{FvType, SchemaSpec};
let sig = SchemaSpec::new([("id", FvType::Int64), ("amount", FvType::Float64)]);
assert!(sig.has_column("amount"));Sourcepub fn named(
name: impl Into<String>,
columns: impl IntoIterator<Item = impl Into<ColumnSpec>>,
) -> Self
pub fn named( name: impl Into<String>, columns: impl IntoIterator<Item = impl Into<ColumnSpec>>, ) -> Self
A named signature (required when a transform has more than one input).
Sourcepub fn to_arrow_schema(&self) -> Schema
pub fn to_arrow_schema(&self) -> Schema
Materialize as an Arrow Schema. All fields nullable=true (the plane is null-tolerant;
tighter nullability is a refinement).
pub fn to_arrow_schema_ref(&self) -> Arc<Schema> ⓘ
Sourcepub fn has_column(&self, name: &str) -> bool
pub fn has_column(&self, name: &str) -> bool
Does this signature contain a column of the given name?
Trait Implementations§
Source§impl Clone for SchemaSpec
impl Clone for SchemaSpec
Source§fn clone(&self) -> SchemaSpec
fn clone(&self) -> SchemaSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SchemaSpec
impl Debug for SchemaSpec
Source§impl<'de> Deserialize<'de> for SchemaSpec
impl<'de> Deserialize<'de> for SchemaSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SchemaSpec
Source§impl PartialEq for SchemaSpec
impl PartialEq for SchemaSpec
Source§impl Serialize for SchemaSpec
impl Serialize for SchemaSpec
impl StructuralPartialEq for SchemaSpec
Auto Trait Implementations§
impl Freeze for SchemaSpec
impl RefUnwindSafe for SchemaSpec
impl Send for SchemaSpec
impl Sync for SchemaSpec
impl Unpin for SchemaSpec
impl UnsafeUnpin for SchemaSpec
impl UnwindSafe for SchemaSpec
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.