Trait datafusion_expr::expr_schema::ExprSchemable
source · pub trait ExprSchemable {
// Required methods
fn get_type(&self, schema: &dyn ExprSchema) -> Result<DataType>;
fn nullable(&self, input_schema: &dyn ExprSchema) -> Result<bool>;
fn metadata(
&self,
schema: &dyn ExprSchema,
) -> Result<HashMap<String, String>>;
fn to_field(
&self,
input_schema: &dyn ExprSchema,
) -> Result<(Option<TableReference>, Arc<Field>)>;
fn cast_to(
self,
cast_to_type: &DataType,
schema: &dyn ExprSchema,
) -> Result<Expr>;
fn data_type_and_nullable(
&self,
schema: &dyn ExprSchema,
) -> Result<(DataType, bool)>;
}
Expand description
trait to allow expr to typable with respect to a schema
Required Methods§
sourcefn get_type(&self, schema: &dyn ExprSchema) -> Result<DataType>
fn get_type(&self, schema: &dyn ExprSchema) -> Result<DataType>
given a schema, return the type of the expr
sourcefn nullable(&self, input_schema: &dyn ExprSchema) -> Result<bool>
fn nullable(&self, input_schema: &dyn ExprSchema) -> Result<bool>
given a schema, return the nullability of the expr
sourcefn metadata(&self, schema: &dyn ExprSchema) -> Result<HashMap<String, String>>
fn metadata(&self, schema: &dyn ExprSchema) -> Result<HashMap<String, String>>
given a schema, return the expr’s optional metadata
sourcefn to_field(
&self,
input_schema: &dyn ExprSchema,
) -> Result<(Option<TableReference>, Arc<Field>)>
fn to_field( &self, input_schema: &dyn ExprSchema, ) -> Result<(Option<TableReference>, Arc<Field>)>
convert to a field with respect to a schema
sourcefn cast_to(
self,
cast_to_type: &DataType,
schema: &dyn ExprSchema,
) -> Result<Expr>
fn cast_to( self, cast_to_type: &DataType, schema: &dyn ExprSchema, ) -> Result<Expr>
cast to a type with respect to a schema
sourcefn data_type_and_nullable(
&self,
schema: &dyn ExprSchema,
) -> Result<(DataType, bool)>
fn data_type_and_nullable( &self, schema: &dyn ExprSchema, ) -> Result<(DataType, bool)>
given a schema, return the type and nullability of the expr