All Known Implementing Classes:
IcebergCatalog, InMemoryCatalog

@Internal public interface Catalog
Represents a named and configurable container for managing tables. Is defined with a type and configuration properties. Uses an underlying MetaStore to manage tables and table providers.
  • Field Details

  • Method Details

    • type

      String type()
      A type that defines this catalog.
    • metaStore

      MetaStore metaStore(String database)
      Returns the underlying MetaStore for this database. Creates a new MetaStore if one does not exist yet.
    • currentDatabase

      @Nullable String currentDatabase()
      Produces the currently active database. Can be null if no database is active.
      Returns:
      the current active database
    • createDatabase

      boolean createDatabase(String databaseName)
      Creates a database with this name.
      Parameters:
      databaseName -
      Returns:
      true if the database was created, false otherwise.
    • databaseExists

      boolean databaseExists(String db)
      Returns true if the database exists.
    • useDatabase

      void useDatabase(String databaseName)
      Switches to use the specified database.
      Parameters:
      databaseName -
    • dropDatabase

      boolean dropDatabase(String databaseName, boolean cascade)
      Drops the database with this name. If cascade is true, the catalog should first drop all tables contained in this database.
      Parameters:
      databaseName -
      cascade -
      Returns:
      true if the database was dropped, false otherwise.
    • name

      String name()
      The name of this catalog, specified by the user.
    • properties

      Map<String,String> properties()
      User-specified configuration properties.
    • registerTableProvider

      void registerTableProvider(TableProvider provider)
      Registers this TableProvider and propagates it to underlying MetaStores.
    • tableProviders

      Map<String,TableProvider> tableProviders()
      Returns all the TableProviders available to this Catalog, organized by type.