Trait ExprSchemable

Source
pub trait ExprSchemable {
    // Required methods
    fn get_type(
        &self,
        schema: &dyn ExprSchema,
    ) -> Result<DataType, DataFusionError>;
    fn nullable(
        &self,
        input_schema: &dyn ExprSchema,
    ) -> Result<bool, DataFusionError>;
    fn metadata(
        &self,
        schema: &dyn ExprSchema,
    ) -> Result<HashMap<String, String>, DataFusionError>;
    fn to_field(
        &self,
        input_schema: &dyn ExprSchema,
    ) -> Result<(Option<TableReference>, Arc<Field>), DataFusionError>;
    fn cast_to(
        self,
        cast_to_type: &DataType,
        schema: &dyn ExprSchema,
    ) -> Result<Expr, DataFusionError>;
    fn data_type_and_nullable(
        &self,
        schema: &dyn ExprSchema,
    ) -> Result<(DataType, bool), DataFusionError>;
}
Expand description

Trait to allow expr to typable with respect to a schema

Required Methods§

Source

fn get_type(&self, schema: &dyn ExprSchema) -> Result<DataType, DataFusionError>

Given a schema, return the type of the expr

Source

fn nullable( &self, input_schema: &dyn ExprSchema, ) -> Result<bool, DataFusionError>

Given a schema, return the nullability of the expr

Source

fn metadata( &self, schema: &dyn ExprSchema, ) -> Result<HashMap<String, String>, DataFusionError>

Given a schema, return the expr’s optional metadata

Source

fn to_field( &self, input_schema: &dyn ExprSchema, ) -> Result<(Option<TableReference>, Arc<Field>), DataFusionError>

Convert to a field with respect to a schema

Source

fn cast_to( self, cast_to_type: &DataType, schema: &dyn ExprSchema, ) -> Result<Expr, DataFusionError>

Cast to a type with respect to a schema

Source

fn data_type_and_nullable( &self, schema: &dyn ExprSchema, ) -> Result<(DataType, bool), DataFusionError>

Given a schema, return the type and nullability of the expr

Implementors§