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§
sourcefn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Returns the query engine as Any so that it can be downcast to a specific implementation.
sourcefn planner(&self) -> Arc<dyn LogicalPlanner>
fn planner(&self) -> Arc<dyn LogicalPlanner>
Returns the logical planner
sourcefn 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 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
].
sourcefn 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 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
].
sourcefn register_udf(&self, udf: ScalarUdf)
fn register_udf(&self, udf: ScalarUdf)
Register a ScalarUdf
.
sourcefn register_aggregate_function(&self, func: AggregateFunctionMetaRef)
fn register_aggregate_function(&self, func: AggregateFunctionMetaRef)
Register an aggregate function.
§Panics
Will panic if the function with same name is already registered.
sourcefn register_function(&self, func: FunctionRef)
fn register_function(&self, func: FunctionRef)
Register a SQL function. Will override if the function with same name is already registered.
sourcefn read_table(&self, table: TableRef) -> Result<DataFrame>
fn read_table(&self, table: TableRef) -> Result<DataFrame>
Create a DataFrame from a table.
sourcefn engine_context(&self, query_ctx: QueryContextRef) -> QueryEngineContext
fn engine_context(&self, query_ctx: QueryContextRef) -> QueryEngineContext
Create a QueryEngineContext
.
sourcefn engine_state(&self) -> &QueryEngineState
fn engine_state(&self) -> &QueryEngineState
Retrieve the query engine state QueryEngineState