Trait query::query_engine::QueryEngine

source ·
pub trait QueryEngine: Send + Sync {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn planner(&self) -> Arc<dyn LogicalPlanner>;
    fn name(&self) -> &str;
    fn describe<'life0, 'async_trait>(
        &'life0 self,
        plan: LogicalPlan,
        query_ctx: QueryContextRef,
    ) -> Pin<Box<dyn Future<Output = Result<DescribeResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn execute<'life0, 'async_trait>(
        &'life0 self,
        plan: LogicalPlan,
        query_ctx: QueryContextRef,
    ) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn register_udf(&self, udf: ScalarUdf);
    fn register_aggregate_function(&self, func: AggregateFunctionMetaRef);
    fn register_function(&self, func: FunctionRef);
    fn read_table(&self, table: TableRef) -> Result<DataFrame>;
    fn engine_context(&self, query_ctx: QueryContextRef) -> QueryEngineContext;
    fn engine_state(&self) -> &QueryEngineState;
}

Required Methods§

source

fn as_any(&self) -> &dyn Any

Returns the query engine as Any so that it can be downcast to a specific implementation.

source

fn planner(&self) -> Arc<dyn LogicalPlanner>

Returns the logical planner

source

fn name(&self) -> &str

Returns the query engine name.

source

fn describe<'life0, 'async_trait>( &'life0 self, plan: LogicalPlan, query_ctx: QueryContextRef, ) -> Pin<Box<dyn Future<Output = Result<DescribeResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Describe the given [LogicalPlan].

source

fn execute<'life0, 'async_trait>( &'life0 self, plan: LogicalPlan, query_ctx: QueryContextRef, ) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute the given [LogicalPlan].

source

fn register_udf(&self, udf: ScalarUdf)

Register a [ScalarUdf].

source

fn register_aggregate_function(&self, func: AggregateFunctionMetaRef)

Register an aggregate function.

§Panics

Will panic if the function with same name is already registered.

source

fn register_function(&self, func: FunctionRef)

Register a SQL function. Will override if the function with same name is already registered.

source

fn read_table(&self, table: TableRef) -> Result<DataFrame>

Create a DataFrame from a table.

source

fn engine_context(&self, query_ctx: QueryContextRef) -> QueryEngineContext

source

fn engine_state(&self) -> &QueryEngineState

Retrieve the query engine state QueryEngineState

Implementors§