Skip to main content

CatalogProvider

Trait CatalogProvider 

Source
pub trait CatalogProvider: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn list_catalogs<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<CatalogInfo>, CatalogError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn get_catalog<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<CatalogInfo, CatalogError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn list_schemas<'life0, 'life1, 'async_trait>(
        &'life0 self,
        catalog_name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<SchemaInfo>, CatalogError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn get_schema<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        catalog_name: &'life1 str,
        schema_name: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<SchemaInfo, CatalogError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait;
    fn list_tables<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        catalog_name: &'life1 str,
        schema_name: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<TableInfo>, CatalogError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait;
    fn get_table<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        catalog_name: &'life1 str,
        schema_name: &'life2 str,
        table_name: &'life3 str,
    ) -> Pin<Box<dyn Future<Output = Result<TableInfo, CatalogError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             Self: 'async_trait;

    // Provided method
    fn table_to_arrow_schema(
        &self,
        table: &TableInfo,
    ) -> Result<Arc<Schema>, CatalogError> { ... }
}
Expand description

Abstract trait for browsing an external catalog.

Analogous to Presto’s ConnectorMetadata. Implementations provide access to catalog metadata (catalogs, schemas, tables, columns) without being coupled to any specific data format or storage backend.

§Extensibility

Implement this trait to add support for new catalog backends:

  • Unity Catalog (provided)
  • Hive Metastore (future)
  • AWS Glue (future)
  • Iceberg REST Catalog (future)

Required Methods§

Source

fn name(&self) -> &str

Human-readable name of this catalog provider (e.g., “unity-catalog”).

Source

fn list_catalogs<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<CatalogInfo>, CatalogError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

List all catalogs available in this provider.

Source

fn get_catalog<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<CatalogInfo, CatalogError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Get information about a specific catalog.

Source

fn list_schemas<'life0, 'life1, 'async_trait>( &'life0 self, catalog_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<SchemaInfo>, CatalogError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

List all schemas within a catalog.

Source

fn get_schema<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, catalog_name: &'life1 str, schema_name: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<SchemaInfo, CatalogError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Get information about a specific schema.

Source

fn list_tables<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, catalog_name: &'life1 str, schema_name: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<TableInfo>, CatalogError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

List all tables within a schema.

Source

fn get_table<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, catalog_name: &'life1 str, schema_name: &'life2 str, table_name: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<TableInfo, CatalogError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait,

Get detailed information about a specific table, including columns.

Provided Methods§

Source

fn table_to_arrow_schema( &self, table: &TableInfo, ) -> Result<Arc<Schema>, CatalogError>

Convert a table’s column definitions to an Arrow schema.

The default implementation uses the standard type mapping from crate::type_mapping::columns_to_arrow_schema.

Implementors§