Trait substrait_expr::helpers::expr::ExpressionExt
source · pub trait ExpressionExt {
// Required methods
fn try_rex_type(&self) -> Result<&RexType, SubstraitExprError>;
fn try_as_rust_literal<T: LiteralInference>(
&self
) -> Result<T, SubstraitExprError>;
fn try_as_literal(&self) -> Result<&Literal, SubstraitExprError>;
fn output_type(
&self,
schema: &SchemaInfo
) -> Result<Type, SubstraitExprError>;
}Expand description
Extends the protobuf Expression object with useful helper methods
Required Methods§
sourcefn try_rex_type(&self) -> Result<&RexType, SubstraitExprError>
fn try_rex_type(&self) -> Result<&RexType, SubstraitExprError>
The rex_type is a required property
This converts an expression’s Option<&RexType> into Result<&RexType> that fails with a “required property missing” error
TODO: Should this be public?
sourcefn try_as_rust_literal<T: LiteralInference>(
&self
) -> Result<T, SubstraitExprError>
fn try_as_rust_literal<T: LiteralInference>( &self ) -> Result<T, SubstraitExprError>
Tries to decode the expression as a rust literal of the given type
sourcefn try_as_literal(&self) -> Result<&Literal, SubstraitExprError>
fn try_as_literal(&self) -> Result<&Literal, SubstraitExprError>
Tries to decode the expression as a Substrait literal
sourcefn output_type(&self, schema: &SchemaInfo) -> Result<Type, SubstraitExprError>
fn output_type(&self, schema: &SchemaInfo) -> Result<Type, SubstraitExprError>
Determines the output type of the expression
TODO: Explain this more
Object Safety§
This trait is not object safe.