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§

source

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?

source

fn try_as_rust_literal<T: LiteralInference>( &self ) -> Result<T, SubstraitExprError>

Tries to decode the expression as a rust literal of the given type

source

fn try_as_literal(&self) -> Result<&Literal, SubstraitExprError>

Tries to decode the expression as a Substrait literal

source

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.

Implementations on Foreign Types§

source§

impl ExpressionExt for Expression

Implementors§