Skip to main content

TypePlanner

Trait TypePlanner 

Source
pub trait TypePlanner:
    Debug
    + Send
    + Sync {
    // Provided methods
    fn plan_type(
        &self,
        _sql_type: &DataType,
    ) -> Result<Option<DataType>, DataFusionError> { ... }
    fn plan_type_field(
        &self,
        sql_type: &DataType,
    ) -> Result<Option<Arc<Field>>, DataFusionError> { ... }
}
Expand description

Customize planning SQL types to DataFusion (Arrow) types. For more background, please also see the Extending SQL in DataFusion: from ->> to TABLESAMPLE blog

Provided Methods§

Source

fn plan_type( &self, _sql_type: &DataType, ) -> Result<Option<DataType>, DataFusionError>

👎Deprecated since 53.0.0:

Use plan_type_field()

Plan SQL sqlparser::ast::DataType to DataFusion DataType

Returns None if not possible

Source

fn plan_type_field( &self, sql_type: &DataType, ) -> Result<Option<Arc<Field>>, DataFusionError>

Plan SQL sqlparser::ast::DataType to DataFusion FieldRef

Returns None if not possible. Unlike Self::plan_type, plan_type_field() makes it possible to express extension types (e.g., arrow.uuid) or otherwise insert metadata into the DataFusion type representation. The default implementation falls back on Self::plan_type for backward compatibility and wraps the result in a nullable field reference.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§