pub trait SQLExecutor: Sync + Send {
// Required methods
fn name(&self) -> &str;
fn compute_context(&self) -> Option<String>;
fn dialect(&self) -> Arc<dyn Dialect>;
fn execute(
&self,
query: &str,
schema: SchemaRef,
filters: &[Arc<dyn PhysicalExpr>],
) -> Result<SendableRecordBatchStream>;
fn table_names<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_table_schema<'life0, 'life1, 'async_trait>(
&'life0 self,
table_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<SchemaRef>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn logical_optimizer(&self) -> Option<LogicalOptimizer> { ... }
fn ast_analyzer(&self) -> Option<AstAnalyzer> { ... }
fn statistics<'life0, 'life1, 'async_trait>(
&'life0 self,
plan: &'life1 LogicalPlan,
) -> Pin<Box<dyn Future<Output = Result<Statistics>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn metrics(&self) -> Option<MetricsSet> { ... }
}Required Methods§
Sourcefn compute_context(&self) -> Option<String>
fn compute_context(&self) -> Option<String>
Executor compute context allows differentiating the remote compute context such as authorization or active database.
Note: returning None here may cause incorrect federation with other providers of the same name that also have a compute_context of None. Instead try to return a unique string that will never match any other provider’s context.
Sourcefn dialect(&self) -> Arc<dyn Dialect>
fn dialect(&self) -> Arc<dyn Dialect>
The specific SQL dialect (currently supports ‘sqlite’, ‘postgres’, ‘flight’)
Sourcefn execute(
&self,
query: &str,
schema: SchemaRef,
filters: &[Arc<dyn PhysicalExpr>],
) -> Result<SendableRecordBatchStream>
fn execute( &self, query: &str, schema: SchemaRef, filters: &[Arc<dyn PhysicalExpr>], ) -> Result<SendableRecordBatchStream>
Execute a SQL query.
filters contain physical expressions generated at runtime, like
DynamicFilterPhysicalExpr. Since the concrete expression values only become available when
the SendableRecordBatchStream is executed, they must be manually added to the SQL query,
if necessary. However, they can be safely ignored.
Sourcefn table_names<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn table_names<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the tables provided by the remote
Sourcefn get_table_schema<'life0, 'life1, 'async_trait>(
&'life0 self,
table_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<SchemaRef>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_table_schema<'life0, 'life1, 'async_trait>(
&'life0 self,
table_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<SchemaRef>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns the schema of table_name within this SQLExecutor
Provided Methods§
Sourcefn logical_optimizer(&self) -> Option<LogicalOptimizer>
fn logical_optimizer(&self) -> Option<LogicalOptimizer>
Returns the analyzer rule specific for this engine to modify the logical plan before execution
Sourcefn ast_analyzer(&self) -> Option<AstAnalyzer>
fn ast_analyzer(&self) -> Option<AstAnalyzer>
Returns an AST analyzer specific for this engine to modify the AST before execution
Sourcefn statistics<'life0, 'life1, 'async_trait>(
&'life0 self,
plan: &'life1 LogicalPlan,
) -> Pin<Box<dyn Future<Output = Result<Statistics>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn statistics<'life0, 'life1, 'async_trait>(
&'life0 self,
plan: &'life1 LogicalPlan,
) -> Pin<Box<dyn Future<Output = Result<Statistics>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns statistics for this SQLExecutor node. If statistics are not available, it should
return Statistics::new_unknown (the default), not an error. See the ExecutionPlan
trait.
Sourcefn metrics(&self) -> Option<MetricsSet>
fn metrics(&self) -> Option<MetricsSet>
Returns the execution metrics, if available.