Enum substrait_expr::helpers::schema::SchemaInfo
source · 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
impl SchemaInfo
sourcepub fn extensions_registry(&self) -> &ExtensionsRegistry
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
sourcepub fn names_aware(&self) -> bool
pub fn names_aware(&self) -> bool
Return true if this schema knows the names of its fields
sourcepub fn types_aware(&self) -> bool
pub fn types_aware(&self) -> bool
Return true if this schema knows the types of its fields
sourcepub fn names_dfs<'a>(
&'a self
) -> Result<Box<dyn Iterator<Item = &str> + 'a>, SubstraitExprError>
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
sourcepub fn types_dfs<'a>(
&'a self,
include_inner: bool
) -> Box<dyn Iterator<Item = Type> + 'a>
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
sourcepub fn to_substrait(self) -> NamedStruct
pub fn to_substrait(self) -> NamedStruct
Converts to a NamedStruct which is the closest equivalent SubstraitMessage
sourcepub fn resolve_type(
&self,
ref_seg: &ReferenceSegment
) -> Result<Type, SubstraitExprError>
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
impl Debug for SchemaInfo
source§impl PartialEq for SchemaInfo
impl PartialEq for SchemaInfo
source§fn eq(&self, other: &SchemaInfo) -> bool
fn eq(&self, other: &SchemaInfo) -> bool
self and other values to be equal, and is used
by ==.