AsyncCatalogProviderList

Trait AsyncCatalogProviderList 

Source
pub trait AsyncCatalogProviderList: Send + Sync {
    // Required method
    fn catalog<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Arc<dyn AsyncCatalogProvider>>, DataFusionError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;

    // Provided method
    fn resolve<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        references: &'life1 [TableReference],
        config: &'life2 SessionConfig,
    ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn CatalogProviderList>, DataFusionError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait { ... }
}
Expand description

A trait for catalog provider lists that must resolve catalogs asynchronously

The CatalogProviderList::catalog method is synchronous because asynchronous operations should not be used during planning. This trait makes it easy to lookup catalog references once and cache them for future planning use. See AsyncSchemaProvider for more details on motivation.

Required Methods§

Source

fn catalog<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Arc<dyn AsyncCatalogProvider>>, DataFusionError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Lookup a catalog in the provider

Provided Methods§

Source

fn resolve<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, references: &'life1 [TableReference], config: &'life2 SessionConfig, ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn CatalogProviderList>, DataFusionError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Creates a cached provider that can be used to execute a query containing given references

This method will walk through the references and look them up once, creating a cache of catalog providers, schema providers, and table providers. This cache will be returned as a synchronous CatalogProvider that can be used to plan and execute a query containing the given references.

This cache is intended to be short-lived for the execution of a single query. There is no mechanism for refresh or eviction of stale entries.

Implementors§