pub enum SchemaInfo {
    Empty(EmptySchema),
    Names(NamesOnlySchema),
    Types(TypesOnlySchema),
    Full(FullSchema),
}
Expand description

A schema represents what we know about the input to an expression

TODO: Expand, copy over content from crate docs

Variants§

Implementations§

source§

impl SchemaInfo

source

pub fn extensions_registry(&self) -> &ExtensionsRegistry

Return a reference to the schema’s extensions registry

This registry keeps track of the user defined types that are referenced by the schema

source

pub fn names_aware(&self) -> bool

Return true if this schema knows the names of its fields

source

pub fn types_aware(&self) -> bool

Return true if this schema knows the types of its fields

source

pub fn len_aware(&self) -> bool

Return true if this schema knows the number of fields

source

pub fn names_dfs<'a>( &'a self ) -> Result<Box<dyn Iterator<Item = &str> + 'a>, SubstraitExprError>

Returns an iterator through the names of the fields, in DFS order

Returns an error if the schema does not know the names of its fields

source

pub fn types_dfs<'a>( &'a self, include_inner: bool ) -> Box<dyn Iterator<Item = Type> + 'a>

Returns an iterator through the types of the fields, in DFS order

If the schema is empty this will return an empty iterator If this schema is names-only the types will all be the unknown type

TODO: Explain include_inner, provide examples

source

pub fn to_substrait(self) -> NamedStruct

Converts to a NamedStruct which is the closest equivalent SubstraitMessage

source

pub fn resolve_type( &self, ref_seg: &ReferenceSegment ) -> Result<Type, SubstraitExprError>

Return the type of the field referenced by ref_seg

Returns an error if the reference does not refer to a field in the schema

If types are not known then the returned type will be the unknown type

Trait Implementations§

source§

impl Debug for SchemaInfo

source§

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

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

impl PartialEq for SchemaInfo

source§

fn eq(&self, other: &SchemaInfo) -> 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 SchemaBuildersExt for SchemaInfo

source§

fn new_names() -> NamesOnlySchemaNodeBuilder

Create a builder that can be used to create a names-only schema
source§

fn new_types() -> TypesOnlySchemaBuilder

Create a builder that can be used to create a types-only schema
source§

fn new_full() -> FullSchemaBuilder

Create a builder that can be used to create a full schema
source§

impl StructuralPartialEq for SchemaInfo

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