Trait datafusion_federation::sql::SQLExecutor

source ·
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,
    ) -> 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 method
    fn ast_analyzer(
        &self,
    ) -> Option<Box<dyn Fn(Statement) -> Result<Statement>>> { ... }
}

Required Methods§

source

fn name(&self) -> &str

Executor name

source

fn compute_context(&self) -> Option<String>

Executor compute context allows differentiating the remote compute context such as authorization or active database.

source

fn dialect(&self) -> Arc<dyn Dialect>

source

fn execute( &self, query: &str, schema: SchemaRef, ) -> Result<SendableRecordBatchStream>

Execute a SQL query

source

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

source

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§

source

fn ast_analyzer(&self) -> Option<Box<dyn Fn(Statement) -> Result<Statement>>>

Returns an AST analyzer specific for this engine to modify the AST before execution

Trait Implementations§

source§

impl Debug for dyn SQLExecutor

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for dyn SQLExecutor

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Implementors§