SQLTable

Trait SQLTable 

Source
pub trait SQLTable:
    Debug
    + Send
    + Sync {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn table_reference(&self) -> TableReference;
    fn schema(&self) -> SchemaRef;

    // Provided methods
    fn logical_optimizer(&self) -> Option<LogicalOptimizer> { ... }
    fn ast_analyzer(&self) -> Option<AstAnalyzer> { ... }
}
Expand description

Trait to represent a SQL remote table inside SQLTableSource. A remote table provides information such as schema, table reference, and provides hooks for rewriting the logical plan and AST before execution. This crate provides RemoteTable as a default ready-to-use type.

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Returns a reference as a trait object.

Source

fn table_reference(&self) -> TableReference

Provides the TableReference used to identify the table in SQL queries. This TableReference is used for registering the table with the SQLSchemaProvider. If the table provider is registered in the Datafusion context under a different name, the logical plan will be rewritten to use this table reference during execution. Therefore, any AST analyzer should match against this table reference.

Source

fn schema(&self) -> SchemaRef

Schema of the remote table

Provided Methods§

Source

fn logical_optimizer(&self) -> Option<LogicalOptimizer>

Returns a logical optimizer specific to this table, will be used to modify the logical plan before execution

Source

fn ast_analyzer(&self) -> Option<AstAnalyzer>

Returns an AST analyzer specific to this table, will be used to modify the AST before execution

Implementors§