Interface Catalog


@PublicEvolving public interface Catalog
This interface is responsible for reading and writing metadata such as database/table/views/UDFs from a registered catalog. It connects a registered catalog and Flink's Table API. This interface only processes permanent metadata objects. In order to process temporary objects, a catalog can also implement the TemporaryOperationListener interface.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    alterDatabase(String name, org.apache.flink.table.catalog.CatalogDatabase newDatabase, boolean ignoreIfNotExists)
    Modify an existing database.
    void
    alterFunction(org.apache.flink.table.catalog.ObjectPath functionPath, CatalogFunction newFunction, boolean ignoreIfNotExists)
    Modify an existing function.
    default void
    alterModel(org.apache.flink.table.catalog.ObjectPath modelPath, CatalogModel newModel, boolean ignoreIfNotExists)
    Modifies an existing model.
    default void
    alterModel(org.apache.flink.table.catalog.ObjectPath modelPath, CatalogModel newModel, List<org.apache.flink.table.catalog.ModelChange> modelChanges, boolean ignoreIfNotExists)
    Modifies an existing model.
    void
    alterPartition(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec, org.apache.flink.table.catalog.CatalogPartition newPartition, boolean ignoreIfNotExists)
    Alter a partition.
    void
    alterPartitionColumnStatistics(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec, org.apache.flink.table.catalog.stats.CatalogColumnStatistics columnStatistics, boolean ignoreIfNotExists)
    Update the column statistics of a table partition.
    void
    alterPartitionStatistics(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec, org.apache.flink.table.catalog.stats.CatalogTableStatistics partitionStatistics, boolean ignoreIfNotExists)
    Update the statistics of a table partition.
    void
    alterTable(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogBaseTable newTable, boolean ignoreIfNotExists)
    Modifies an existing table or view.
    default void
    alterTable(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogBaseTable newTable, List<org.apache.flink.table.catalog.TableChange> tableChanges, boolean ignoreIfNotExists)
    Modifies an existing table or view.
    void
    alterTableColumnStatistics(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.stats.CatalogColumnStatistics columnStatistics, boolean ignoreIfNotExists)
    Update the column statistics of a table.
    void
    alterTableStatistics(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.stats.CatalogTableStatistics tableStatistics, boolean ignoreIfNotExists)
    Update the statistics of a table.
    default List<org.apache.flink.table.catalog.stats.CatalogColumnStatistics>
    bulkGetPartitionColumnStatistics(org.apache.flink.table.catalog.ObjectPath tablePath, List<org.apache.flink.table.catalog.CatalogPartitionSpec> partitionSpecs)
    Get a list of column statistics for given partitions.
    default List<org.apache.flink.table.catalog.stats.CatalogTableStatistics>
    bulkGetPartitionStatistics(org.apache.flink.table.catalog.ObjectPath tablePath, List<org.apache.flink.table.catalog.CatalogPartitionSpec> partitionSpecs)
    Get a list of statistics of given partitions.
    void
    Close the catalog when it is no longer needed and release any resource that it might be holding.
    void
    createDatabase(String name, org.apache.flink.table.catalog.CatalogDatabase database, boolean ignoreIfExists)
    Create a database.
    void
    createFunction(org.apache.flink.table.catalog.ObjectPath functionPath, CatalogFunction function, boolean ignoreIfExists)
    Create a function.
    default void
    createModel(org.apache.flink.table.catalog.ObjectPath modelPath, CatalogModel model, boolean ignoreIfExists)
    Creates a new model.
    void
    createPartition(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec, org.apache.flink.table.catalog.CatalogPartition partition, boolean ignoreIfExists)
    Create a partition.
    void
    createTable(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogBaseTable table, boolean ignoreIfExists)
    Creates a new table or view.
    boolean
    databaseExists(String databaseName)
    Check if a database exists in this catalog.
    default void
    dropDatabase(String name, boolean ignoreIfNotExists)
    Drop a database.
    void
    dropDatabase(String name, boolean ignoreIfNotExists, boolean cascade)
    Drop a database.
    void
    dropFunction(org.apache.flink.table.catalog.ObjectPath functionPath, boolean ignoreIfNotExists)
    Drop a function.
    default void
    dropModel(org.apache.flink.table.catalog.ObjectPath modelPath, boolean ignoreIfNotExists)
    Drop a model.
    void
    dropPartition(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec, boolean ignoreIfNotExists)
    Drop a partition.
    void
    dropTable(org.apache.flink.table.catalog.ObjectPath tablePath, boolean ignoreIfNotExists)
    Drop a table or view.
    boolean
    functionExists(org.apache.flink.table.catalog.ObjectPath functionPath)
    Check whether a function exists or not.
    org.apache.flink.table.catalog.CatalogDatabase
    getDatabase(String databaseName)
    Get a database from this catalog.
    Get the name of the default database for this catalog.
    default Optional<org.apache.flink.table.factories.Factory>
    Returns a factory for creating instances from catalog objects.
    getFunction(org.apache.flink.table.catalog.ObjectPath functionPath)
    Get the function.
    default Optional<org.apache.flink.table.factories.FunctionDefinitionFactory>
    Get an optional FunctionDefinitionFactory instance that's responsible for instantiating function definitions.
    default CatalogModel
    getModel(org.apache.flink.table.catalog.ObjectPath modelPath)
    Returns a CatalogModel identified by the given ObjectPath.
    org.apache.flink.table.catalog.CatalogPartition
    getPartition(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec)
    Get a partition of the given table.
    org.apache.flink.table.catalog.stats.CatalogColumnStatistics
    getPartitionColumnStatistics(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec)
    Get the column statistics of a partition.
    org.apache.flink.table.catalog.stats.CatalogTableStatistics
    getPartitionStatistics(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec)
    Get the statistics of a partition.
    default org.apache.flink.table.procedures.Procedure
    getProcedure(org.apache.flink.table.catalog.ObjectPath procedurePath)
    Get the procedure.
    org.apache.flink.table.catalog.CatalogBaseTable
    getTable(org.apache.flink.table.catalog.ObjectPath tablePath)
    Returns a CatalogTable or CatalogView identified by the given ObjectPath.
    default org.apache.flink.table.catalog.CatalogBaseTable
    getTable(org.apache.flink.table.catalog.ObjectPath tablePath, long timestamp)
    Returns a CatalogTable or CatalogView at a specific time identified by the given ObjectPath.
    org.apache.flink.table.catalog.stats.CatalogColumnStatistics
    getTableColumnStatistics(org.apache.flink.table.catalog.ObjectPath tablePath)
    Get the column statistics of a table.
    org.apache.flink.table.catalog.stats.CatalogTableStatistics
    getTableStatistics(org.apache.flink.table.catalog.ObjectPath tablePath)
    Get the statistics of a table.
    Get the names of all databases in this catalog.
    List the names of all functions in the given database.
    default List<String>
    Get names of all materialized tables under this database.
    default List<String>
    listModels(String databaseName)
    Get names of all models under this database.
    List<org.apache.flink.table.catalog.CatalogPartitionSpec>
    listPartitions(org.apache.flink.table.catalog.ObjectPath tablePath)
    Get CatalogPartitionSpec of all partitions of the table.
    List<org.apache.flink.table.catalog.CatalogPartitionSpec>
    listPartitions(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec)
    Get CatalogPartitionSpec of all partitions that is under the given CatalogPartitionSpec in the table.
    List<org.apache.flink.table.catalog.CatalogPartitionSpec>
    listPartitionsByFilter(org.apache.flink.table.catalog.ObjectPath tablePath, List<Expression> filters)
    Get CatalogPartitionSpec of partitions by expression filters in the table.
    default List<String>
    List the names of all procedures in the given database.
    listTables(String databaseName)
    Get names of all tables, views and materialized tables under this database.
    listViews(String databaseName)
    Get names of all views under this database.
    default boolean
    modelExists(org.apache.flink.table.catalog.ObjectPath modelPath)
    Check if a model exists in this catalog.
    void
    Open the catalog.
    boolean
    partitionExists(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec)
    Check whether a partition exists or not.
    default void
    renameModel(org.apache.flink.table.catalog.ObjectPath modelPath, String newModelName, boolean ignoreIfNotExists)
    Rename an existing model.
    void
    renameTable(org.apache.flink.table.catalog.ObjectPath tablePath, String newTableName, boolean ignoreIfNotExists)
    Rename an existing table or view.
    boolean
    tableExists(org.apache.flink.table.catalog.ObjectPath tablePath)
    Check if a table or view exists in this catalog.
  • Method Details

    • getFactory

      default Optional<org.apache.flink.table.factories.Factory> getFactory()
      Returns a factory for creating instances from catalog objects.

      This method enables bypassing the discovery process. Implementers can directly pass internal catalog-specific objects to their own factory. For example, a custom CatalogTable can be processed by a custom DynamicTableFactory.

      If this catalog support to create materialized table, you should also override this method to provide DynamicTableFactory which help planner to find DynamicTableSource and DynamicTableSink correctly during compile optimization phase. If you don't override this method, you must specify the physical connector identifier that this catalog represents storage when create materialized table. Otherwise, the planner can't find the DynamicTableFactory.

      Because all factories are interfaces, the returned Factory instance can implement multiple supported extension points. An instanceof check is performed by the caller that checks whether a required factory is implemented; otherwise the discovery process is used.

    • getFunctionDefinitionFactory

      default Optional<org.apache.flink.table.factories.FunctionDefinitionFactory> getFunctionDefinitionFactory()
      Get an optional FunctionDefinitionFactory instance that's responsible for instantiating function definitions.
      Returns:
      an optional FunctionDefinitionFactory instance
    • open

      void open() throws org.apache.flink.table.catalog.exceptions.CatalogException
      Open the catalog. Used for any required preparation in initialization phase.
      Throws:
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • close

      void close() throws org.apache.flink.table.catalog.exceptions.CatalogException
      Close the catalog when it is no longer needed and release any resource that it might be holding.
      Throws:
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • getDefaultDatabase

      @Nullable String getDefaultDatabase() throws org.apache.flink.table.catalog.exceptions.CatalogException
      Get the name of the default database for this catalog. The default database will be the current database for the catalog when user's session doesn't specify a current database. The value probably comes from configuration, will not change for the life time of the catalog instance.

      If the default database is null, users will need to set a current database themselves or qualify identifiers at least with the database name when using the catalog.

      Returns:
      the name of the current database
      Throws:
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • listDatabases

      List<String> listDatabases() throws org.apache.flink.table.catalog.exceptions.CatalogException
      Get the names of all databases in this catalog.
      Returns:
      a list of the names of all databases
      Throws:
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • getDatabase

      org.apache.flink.table.catalog.CatalogDatabase getDatabase(String databaseName) throws org.apache.flink.table.catalog.exceptions.DatabaseNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Get a database from this catalog.
      Parameters:
      databaseName - Name of the database
      Returns:
      The requested database
      Throws:
      org.apache.flink.table.catalog.exceptions.DatabaseNotExistException - if the database does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • databaseExists

      boolean databaseExists(String databaseName) throws org.apache.flink.table.catalog.exceptions.CatalogException
      Check if a database exists in this catalog.
      Parameters:
      databaseName - Name of the database
      Returns:
      true if the given database exists in the catalog false otherwise
      Throws:
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • createDatabase

      void createDatabase(String name, org.apache.flink.table.catalog.CatalogDatabase database, boolean ignoreIfExists) throws org.apache.flink.table.catalog.exceptions.DatabaseAlreadyExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Create a database.
      Parameters:
      name - Name of the database to be created
      database - The database definition
      ignoreIfExists - Flag to specify behavior when a database with the given name already exists: if set to false, throw a DatabaseAlreadyExistException, if set to true, do nothing.
      Throws:
      org.apache.flink.table.catalog.exceptions.DatabaseAlreadyExistException - if the given database already exists and ignoreIfExists is false
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • dropDatabase

      default void dropDatabase(String name, boolean ignoreIfNotExists) throws org.apache.flink.table.catalog.exceptions.DatabaseNotExistException, org.apache.flink.table.catalog.exceptions.DatabaseNotEmptyException, org.apache.flink.table.catalog.exceptions.CatalogException
      Drop a database.
      Parameters:
      name - Name of the database to be dropped.
      ignoreIfNotExists - Flag to specify behavior when the database does not exist: if set to false, throw an exception, if set to true, do nothing.
      Throws:
      org.apache.flink.table.catalog.exceptions.DatabaseNotExistException - if the given database does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
      org.apache.flink.table.catalog.exceptions.DatabaseNotEmptyException
    • dropDatabase

      void dropDatabase(String name, boolean ignoreIfNotExists, boolean cascade) throws org.apache.flink.table.catalog.exceptions.DatabaseNotExistException, org.apache.flink.table.catalog.exceptions.DatabaseNotEmptyException, org.apache.flink.table.catalog.exceptions.CatalogException
      Drop a database.
      Parameters:
      name - Name of the database to be dropped.
      ignoreIfNotExists - Flag to specify behavior when the database does not exist: if set to false, throw an exception, if set to true, do nothing.
      cascade - Flag to specify behavior when the database contains table or function: if set to true, delete all tables and functions in the database and then delete the database, if set to false, throw an exception.
      Throws:
      org.apache.flink.table.catalog.exceptions.DatabaseNotExistException - if the given database does not exist
      org.apache.flink.table.catalog.exceptions.DatabaseNotEmptyException - if the given database is not empty and isRestrict is true
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • alterDatabase

      void alterDatabase(String name, org.apache.flink.table.catalog.CatalogDatabase newDatabase, boolean ignoreIfNotExists) throws org.apache.flink.table.catalog.exceptions.DatabaseNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Modify an existing database.
      Parameters:
      name - Name of the database to be modified
      newDatabase - The new database definition
      ignoreIfNotExists - Flag to specify behavior when the given database does not exist: if set to false, throw an exception, if set to true, do nothing.
      Throws:
      org.apache.flink.table.catalog.exceptions.DatabaseNotExistException - if the given database does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • listTables

      List<String> listTables(String databaseName) throws org.apache.flink.table.catalog.exceptions.DatabaseNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Get names of all tables, views and materialized tables under this database. An empty list is returned if none exists.
      Returns:
      a list of the names of all tables, views and materialized tables in this database
      Throws:
      org.apache.flink.table.catalog.exceptions.DatabaseNotExistException - if the database does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • listViews

      List<String> listViews(String databaseName) throws org.apache.flink.table.catalog.exceptions.DatabaseNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Get names of all views under this database. An empty list is returned if none exists.
      Parameters:
      databaseName - the name of the given database
      Returns:
      a list of the names of all views in the given database
      Throws:
      org.apache.flink.table.catalog.exceptions.DatabaseNotExistException - if the database does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • listMaterializedTables

      default List<String> listMaterializedTables(String databaseName) throws org.apache.flink.table.catalog.exceptions.DatabaseNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Get names of all materialized tables under this database. An empty list is returned if none exists.
      Parameters:
      databaseName - the name of the given database
      Returns:
      a list of the names of all materialized tables in the given database
      Throws:
      org.apache.flink.table.catalog.exceptions.DatabaseNotExistException - if the database does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • getTable

      org.apache.flink.table.catalog.CatalogBaseTable getTable(org.apache.flink.table.catalog.ObjectPath tablePath) throws org.apache.flink.table.catalog.exceptions.TableNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Returns a CatalogTable or CatalogView identified by the given ObjectPath. The framework will resolve the metadata objects when necessary.
      Parameters:
      tablePath - Path of the table or view
      Returns:
      The requested table or view
      Throws:
      org.apache.flink.table.catalog.exceptions.TableNotExistException - if the target does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • getTable

      default org.apache.flink.table.catalog.CatalogBaseTable getTable(org.apache.flink.table.catalog.ObjectPath tablePath, long timestamp) throws org.apache.flink.table.catalog.exceptions.TableNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Returns a CatalogTable or CatalogView at a specific time identified by the given ObjectPath. The framework will resolve the metadata objects when necessary.
      Parameters:
      tablePath - Path of the table or view
      timestamp - Timestamp of the table snapshot, which is milliseconds since 1970-01-01 00:00:00 UTC
      Returns:
      The requested table or view
      Throws:
      org.apache.flink.table.catalog.exceptions.TableNotExistException - if the target does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • tableExists

      boolean tableExists(org.apache.flink.table.catalog.ObjectPath tablePath) throws org.apache.flink.table.catalog.exceptions.CatalogException
      Check if a table or view exists in this catalog.
      Parameters:
      tablePath - Path of the table or view
      Returns:
      true if the given table exists in the catalog false otherwise
      Throws:
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • dropTable

      void dropTable(org.apache.flink.table.catalog.ObjectPath tablePath, boolean ignoreIfNotExists) throws org.apache.flink.table.catalog.exceptions.TableNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Drop a table or view.
      Parameters:
      tablePath - Path of the table or view to be dropped
      ignoreIfNotExists - Flag to specify behavior when the table or view does not exist: if set to false, throw an exception, if set to true, do nothing.
      Throws:
      org.apache.flink.table.catalog.exceptions.TableNotExistException - if the table or view does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • renameTable

      void renameTable(org.apache.flink.table.catalog.ObjectPath tablePath, String newTableName, boolean ignoreIfNotExists) throws org.apache.flink.table.catalog.exceptions.TableNotExistException, org.apache.flink.table.catalog.exceptions.TableAlreadyExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Rename an existing table or view.
      Parameters:
      tablePath - Path of the table or view to be renamed
      newTableName - the new name of the table or view
      ignoreIfNotExists - Flag to specify behavior when the table or view does not exist: if set to false, throw an exception, if set to true, do nothing.
      Throws:
      org.apache.flink.table.catalog.exceptions.TableNotExistException - if the table does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
      org.apache.flink.table.catalog.exceptions.TableAlreadyExistException
    • createTable

      void createTable(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogBaseTable table, boolean ignoreIfExists) throws org.apache.flink.table.catalog.exceptions.TableAlreadyExistException, org.apache.flink.table.catalog.exceptions.DatabaseNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Creates a new table or view.

      The framework will make sure to call this method with fully validated ResolvedCatalogTable or ResolvedCatalogView. Those instances are easy to serialize for a durable catalog implementation.

      Parameters:
      tablePath - path of the table or view to be created
      table - the table definition
      ignoreIfExists - flag to specify behavior when a table or view already exists at the given path: if set to false, it throws a TableAlreadyExistException, if set to true, do nothing.
      Throws:
      org.apache.flink.table.catalog.exceptions.TableAlreadyExistException - if table already exists and ignoreIfExists is false
      org.apache.flink.table.catalog.exceptions.DatabaseNotExistException - if the database in tablePath doesn't exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • alterTable

      void alterTable(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogBaseTable newTable, boolean ignoreIfNotExists) throws org.apache.flink.table.catalog.exceptions.TableNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Modifies an existing table or view. Note that the new and old CatalogBaseTable must be of the same kind. For example, this doesn't allow altering a regular table to partitioned table, or altering a view to a table, and vice versa.

      The framework will make sure to call this method with fully validated ResolvedCatalogTable or ResolvedCatalogView. Those instances are easy to serialize for a durable catalog implementation.

      Parameters:
      tablePath - path of the table or view to be modified
      newTable - the new table definition
      ignoreIfNotExists - flag to specify behavior when the table or view does not exist: if set to false, throw an exception, if set to true, do nothing.
      Throws:
      org.apache.flink.table.catalog.exceptions.TableNotExistException - if the table does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • alterTable

      default void alterTable(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogBaseTable newTable, List<org.apache.flink.table.catalog.TableChange> tableChanges, boolean ignoreIfNotExists) throws org.apache.flink.table.catalog.exceptions.TableNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Modifies an existing table or view. Note that the new and old CatalogBaseTable must be of the same kind. For example, this doesn't allow altering a regular table to partitioned table, or altering a view to a table, and vice versa.

      The framework will make sure to call this method with fully validated ResolvedCatalogTable or ResolvedCatalogView. Those instances are easy to serialize for a durable catalog implementation.

      Parameters:
      tablePath - path of the table or view to be modified
      newTable - the new table definition
      tableChanges - change to describe the modification between the newTable and the original table.
      ignoreIfNotExists - flag to specify behavior when the table or view does not exist: if set to false, throw an exception, if set to true, do nothing.
      Throws:
      org.apache.flink.table.catalog.exceptions.TableNotExistException - if the table does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • listPartitions

      List<org.apache.flink.table.catalog.CatalogPartitionSpec> listPartitions(org.apache.flink.table.catalog.ObjectPath tablePath) throws org.apache.flink.table.catalog.exceptions.TableNotExistException, org.apache.flink.table.catalog.exceptions.TableNotPartitionedException, org.apache.flink.table.catalog.exceptions.CatalogException
      Get CatalogPartitionSpec of all partitions of the table.
      Parameters:
      tablePath - path of the table
      Returns:
      a list of CatalogPartitionSpec of the table
      Throws:
      org.apache.flink.table.catalog.exceptions.TableNotExistException - thrown if the table does not exist in the catalog
      org.apache.flink.table.catalog.exceptions.TableNotPartitionedException - thrown if the table is not partitioned
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • listPartitions

      List<org.apache.flink.table.catalog.CatalogPartitionSpec> listPartitions(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec) throws org.apache.flink.table.catalog.exceptions.TableNotExistException, org.apache.flink.table.catalog.exceptions.TableNotPartitionedException, org.apache.flink.table.catalog.exceptions.PartitionSpecInvalidException, org.apache.flink.table.catalog.exceptions.CatalogException
      Get CatalogPartitionSpec of all partitions that is under the given CatalogPartitionSpec in the table.
      Parameters:
      tablePath - path of the table
      partitionSpec - the partition spec to list
      Returns:
      a list of CatalogPartitionSpec that is under the given CatalogPartitionSpec in the table
      Throws:
      org.apache.flink.table.catalog.exceptions.TableNotExistException - thrown if the table does not exist in the catalog
      org.apache.flink.table.catalog.exceptions.TableNotPartitionedException - thrown if the table is not partitioned
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
      org.apache.flink.table.catalog.exceptions.PartitionSpecInvalidException
    • listPartitionsByFilter

      List<org.apache.flink.table.catalog.CatalogPartitionSpec> listPartitionsByFilter(org.apache.flink.table.catalog.ObjectPath tablePath, List<Expression> filters) throws org.apache.flink.table.catalog.exceptions.TableNotExistException, org.apache.flink.table.catalog.exceptions.TableNotPartitionedException, org.apache.flink.table.catalog.exceptions.CatalogException
      Get CatalogPartitionSpec of partitions by expression filters in the table.

      NOTE: For FieldReferenceExpression, the field index is based on schema of this table instead of partition columns only.

      The passed in predicates have been translated in conjunctive form.

      If catalog does not support this interface at present, throw an UnsupportedOperationException directly. If the catalog does not have a valid filter, throw the UnsupportedOperationException directly. Planner will fallback to get all partitions and filter by itself.

      Parameters:
      tablePath - path of the table
      filters - filters to push down filter to catalog
      Returns:
      a list of CatalogPartitionSpec that is under the given CatalogPartitionSpec in the table
      Throws:
      org.apache.flink.table.catalog.exceptions.TableNotExistException - thrown if the table does not exist in the catalog
      org.apache.flink.table.catalog.exceptions.TableNotPartitionedException - thrown if the table is not partitioned
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • getPartition

      org.apache.flink.table.catalog.CatalogPartition getPartition(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec) throws org.apache.flink.table.catalog.exceptions.PartitionNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Get a partition of the given table. The given partition spec keys and values need to be matched exactly for a result.
      Parameters:
      tablePath - path of the table
      partitionSpec - partition spec of partition to get
      Returns:
      the requested partition
      Throws:
      org.apache.flink.table.catalog.exceptions.PartitionNotExistException - thrown if the partition doesn't exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • partitionExists

      boolean partitionExists(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec) throws org.apache.flink.table.catalog.exceptions.CatalogException
      Check whether a partition exists or not.
      Parameters:
      tablePath - path of the table
      partitionSpec - partition spec of the partition to check
      Throws:
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • createPartition

      void createPartition(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec, org.apache.flink.table.catalog.CatalogPartition partition, boolean ignoreIfExists) throws org.apache.flink.table.catalog.exceptions.TableNotExistException, org.apache.flink.table.catalog.exceptions.TableNotPartitionedException, org.apache.flink.table.catalog.exceptions.PartitionSpecInvalidException, org.apache.flink.table.catalog.exceptions.PartitionAlreadyExistsException, org.apache.flink.table.catalog.exceptions.CatalogException
      Create a partition.
      Parameters:
      tablePath - path of the table.
      partitionSpec - partition spec of the partition
      partition - the partition to add.
      ignoreIfExists - flag to specify behavior if a partition with the given name already exists: if set to false, it throws a PartitionAlreadyExistsException, if set to true, nothing happens.
      Throws:
      org.apache.flink.table.catalog.exceptions.TableNotExistException - thrown if the target table does not exist
      org.apache.flink.table.catalog.exceptions.TableNotPartitionedException - thrown if the target table is not partitioned
      org.apache.flink.table.catalog.exceptions.PartitionSpecInvalidException - thrown if the given partition spec is invalid
      org.apache.flink.table.catalog.exceptions.PartitionAlreadyExistsException - thrown if the target partition already exists
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • dropPartition

      void dropPartition(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec, boolean ignoreIfNotExists) throws org.apache.flink.table.catalog.exceptions.PartitionNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Drop a partition.
      Parameters:
      tablePath - path of the table.
      partitionSpec - partition spec of the partition to drop
      ignoreIfNotExists - flag to specify behavior if the partition does not exist: if set to false, throw an exception, if set to true, nothing happens.
      Throws:
      org.apache.flink.table.catalog.exceptions.PartitionNotExistException - thrown if the target partition does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • alterPartition

      void alterPartition(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec, org.apache.flink.table.catalog.CatalogPartition newPartition, boolean ignoreIfNotExists) throws org.apache.flink.table.catalog.exceptions.PartitionNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Alter a partition.
      Parameters:
      tablePath - path of the table
      partitionSpec - partition spec of the partition
      newPartition - new partition to replace the old one
      ignoreIfNotExists - flag to specify behavior if the partition does not exist: if set to false, throw an exception, if set to true, nothing happens.
      Throws:
      org.apache.flink.table.catalog.exceptions.PartitionNotExistException - thrown if the target partition does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • listFunctions

      List<String> listFunctions(String dbName) throws org.apache.flink.table.catalog.exceptions.DatabaseNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      List the names of all functions in the given database. An empty list is returned if none is registered.
      Parameters:
      dbName - name of the database.
      Returns:
      a list of the names of the functions in this database
      Throws:
      org.apache.flink.table.catalog.exceptions.DatabaseNotExistException - if the database does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • listProcedures

      default List<String> listProcedures(String dbName) throws org.apache.flink.table.catalog.exceptions.DatabaseNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      List the names of all procedures in the given database. An empty list is returned if no procedure.
      Parameters:
      dbName - name of the database.
      Returns:
      a list of the names of the procedures in this database
      Throws:
      org.apache.flink.table.catalog.exceptions.DatabaseNotExistException - if the database does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • getFunction

      CatalogFunction getFunction(org.apache.flink.table.catalog.ObjectPath functionPath) throws org.apache.flink.table.catalog.exceptions.FunctionNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Get the function. Function name should be handled in a case insensitive way.
      Parameters:
      functionPath - path of the function
      Returns:
      the requested function
      Throws:
      org.apache.flink.table.catalog.exceptions.FunctionNotExistException - if the function does not exist in the catalog
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • getProcedure

      default org.apache.flink.table.procedures.Procedure getProcedure(org.apache.flink.table.catalog.ObjectPath procedurePath) throws org.apache.flink.table.catalog.exceptions.ProcedureNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Get the procedure. The procedure name should be handled in a case-insensitive way.
      Parameters:
      procedurePath - path of the procedure
      Returns:
      the requested procedure
      Throws:
      org.apache.flink.table.catalog.exceptions.ProcedureNotExistException - if the procedure does not exist in the catalog
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • functionExists

      boolean functionExists(org.apache.flink.table.catalog.ObjectPath functionPath) throws org.apache.flink.table.catalog.exceptions.CatalogException
      Check whether a function exists or not. Function name should be handled in a case insensitive way.
      Parameters:
      functionPath - path of the function
      Returns:
      true if the function exists in the catalog false otherwise
      Throws:
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • createFunction

      void createFunction(org.apache.flink.table.catalog.ObjectPath functionPath, CatalogFunction function, boolean ignoreIfExists) throws org.apache.flink.table.catalog.exceptions.FunctionAlreadyExistException, org.apache.flink.table.catalog.exceptions.DatabaseNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Create a function. Function name should be handled in a case insensitive way.
      Parameters:
      functionPath - path of the function
      function - the function to be created
      ignoreIfExists - flag to specify behavior if a function with the given name already exists: if set to false, it throws a FunctionAlreadyExistException, if set to true, nothing happens.
      Throws:
      org.apache.flink.table.catalog.exceptions.FunctionAlreadyExistException - if the function already exist
      org.apache.flink.table.catalog.exceptions.DatabaseNotExistException - if the given database does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • alterFunction

      void alterFunction(org.apache.flink.table.catalog.ObjectPath functionPath, CatalogFunction newFunction, boolean ignoreIfNotExists) throws org.apache.flink.table.catalog.exceptions.FunctionNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Modify an existing function. Function name should be handled in a case insensitive way.
      Parameters:
      functionPath - path of the function
      newFunction - the function to be modified
      ignoreIfNotExists - flag to specify behavior if the function does not exist: if set to false, throw an exception if set to true, nothing happens
      Throws:
      org.apache.flink.table.catalog.exceptions.FunctionNotExistException - if the function does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • dropFunction

      void dropFunction(org.apache.flink.table.catalog.ObjectPath functionPath, boolean ignoreIfNotExists) throws org.apache.flink.table.catalog.exceptions.FunctionNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Drop a function. Function name should be handled in a case insensitive way.
      Parameters:
      functionPath - path of the function to be dropped
      ignoreIfNotExists - flag to specify behavior if the function does not exist: if set to false, throw an exception if set to true, nothing happens
      Throws:
      org.apache.flink.table.catalog.exceptions.FunctionNotExistException - if the function does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • getTableStatistics

      org.apache.flink.table.catalog.stats.CatalogTableStatistics getTableStatistics(org.apache.flink.table.catalog.ObjectPath tablePath) throws org.apache.flink.table.catalog.exceptions.TableNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Get the statistics of a table.
      Parameters:
      tablePath - path of the table
      Returns:
      statistics of the given table
      Throws:
      org.apache.flink.table.catalog.exceptions.TableNotExistException - if the table does not exist in the catalog
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • getTableColumnStatistics

      org.apache.flink.table.catalog.stats.CatalogColumnStatistics getTableColumnStatistics(org.apache.flink.table.catalog.ObjectPath tablePath) throws org.apache.flink.table.catalog.exceptions.TableNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Get the column statistics of a table.
      Parameters:
      tablePath - path of the table
      Returns:
      column statistics of the given table
      Throws:
      org.apache.flink.table.catalog.exceptions.TableNotExistException - if the table does not exist in the catalog
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • getPartitionStatistics

      org.apache.flink.table.catalog.stats.CatalogTableStatistics getPartitionStatistics(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec) throws org.apache.flink.table.catalog.exceptions.PartitionNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Get the statistics of a partition.
      Parameters:
      tablePath - path of the table
      partitionSpec - partition spec of the partition
      Returns:
      statistics of the given partition
      Throws:
      org.apache.flink.table.catalog.exceptions.PartitionNotExistException - if the partition does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • bulkGetPartitionStatistics

      default List<org.apache.flink.table.catalog.stats.CatalogTableStatistics> bulkGetPartitionStatistics(org.apache.flink.table.catalog.ObjectPath tablePath, List<org.apache.flink.table.catalog.CatalogPartitionSpec> partitionSpecs) throws org.apache.flink.table.catalog.exceptions.PartitionNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Get a list of statistics of given partitions.
      Parameters:
      tablePath - path of the table
      partitionSpecs - partition specs of partitions that will be used to filter out all other unrelated statistics, i.e. the statistics fetch will be limited within the given partitions
      Returns:
      list of statistics of given partitions
      Throws:
      org.apache.flink.table.catalog.exceptions.PartitionNotExistException - if one partition does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • getPartitionColumnStatistics

      org.apache.flink.table.catalog.stats.CatalogColumnStatistics getPartitionColumnStatistics(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec) throws org.apache.flink.table.catalog.exceptions.PartitionNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Get the column statistics of a partition.
      Parameters:
      tablePath - path of the table
      partitionSpec - partition spec of the partition
      Returns:
      column statistics of the given partition
      Throws:
      org.apache.flink.table.catalog.exceptions.PartitionNotExistException - if the partition does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • bulkGetPartitionColumnStatistics

      default List<org.apache.flink.table.catalog.stats.CatalogColumnStatistics> bulkGetPartitionColumnStatistics(org.apache.flink.table.catalog.ObjectPath tablePath, List<org.apache.flink.table.catalog.CatalogPartitionSpec> partitionSpecs) throws org.apache.flink.table.catalog.exceptions.PartitionNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Get a list of column statistics for given partitions.
      Parameters:
      tablePath - path of the table
      partitionSpecs - partition specs of partitions that will be used to filter out all other unrelated statistics, i.e. the statistics fetch will be limited within the given partitions
      Returns:
      list of column statistics for given partitions
      Throws:
      org.apache.flink.table.catalog.exceptions.PartitionNotExistException - if one partition does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • alterTableStatistics

      void alterTableStatistics(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.stats.CatalogTableStatistics tableStatistics, boolean ignoreIfNotExists) throws org.apache.flink.table.catalog.exceptions.TableNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Update the statistics of a table.
      Parameters:
      tablePath - path of the table
      tableStatistics - new statistics to update
      ignoreIfNotExists - flag to specify behavior if the table does not exist: if set to false, throw an exception, if set to true, nothing happens.
      Throws:
      org.apache.flink.table.catalog.exceptions.TableNotExistException - if the table does not exist in the catalog
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • alterTableColumnStatistics

      void alterTableColumnStatistics(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.stats.CatalogColumnStatistics columnStatistics, boolean ignoreIfNotExists) throws org.apache.flink.table.catalog.exceptions.TableNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException, org.apache.flink.table.catalog.exceptions.TablePartitionedException
      Update the column statistics of a table.
      Parameters:
      tablePath - path of the table
      columnStatistics - new column statistics to update
      ignoreIfNotExists - flag to specify behavior if the table does not exist: if set to false, throw an exception, if set to true, nothing happens.
      Throws:
      org.apache.flink.table.catalog.exceptions.TableNotExistException - if the table does not exist in the catalog
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
      org.apache.flink.table.catalog.exceptions.TablePartitionedException
    • alterPartitionStatistics

      void alterPartitionStatistics(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec, org.apache.flink.table.catalog.stats.CatalogTableStatistics partitionStatistics, boolean ignoreIfNotExists) throws org.apache.flink.table.catalog.exceptions.PartitionNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Update the statistics of a table partition.
      Parameters:
      tablePath - path of the table
      partitionSpec - partition spec of the partition
      partitionStatistics - new statistics to update
      ignoreIfNotExists - flag to specify behavior if the partition does not exist: if set to false, throw an exception, if set to true, nothing happens.
      Throws:
      org.apache.flink.table.catalog.exceptions.PartitionNotExistException - if the partition does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • alterPartitionColumnStatistics

      void alterPartitionColumnStatistics(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec, org.apache.flink.table.catalog.stats.CatalogColumnStatistics columnStatistics, boolean ignoreIfNotExists) throws org.apache.flink.table.catalog.exceptions.PartitionNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Update the column statistics of a table partition.
      Parameters:
      tablePath - path of the table
      partitionSpec - partition spec of the partition @@param columnStatistics new column statistics to update
      ignoreIfNotExists - flag to specify behavior if the partition does not exist: if set to false, throw an exception, if set to true, nothing happens.
      Throws:
      org.apache.flink.table.catalog.exceptions.PartitionNotExistException - if the partition does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • listModels

      default List<String> listModels(String databaseName) throws org.apache.flink.table.catalog.exceptions.DatabaseNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Get names of all models under this database. An empty list is returned if none exists.
      Returns:
      a list of the names of all models in this database
      Throws:
      org.apache.flink.table.catalog.exceptions.DatabaseNotExistException - if the database does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • getModel

      default CatalogModel getModel(org.apache.flink.table.catalog.ObjectPath modelPath) throws org.apache.flink.table.catalog.exceptions.ModelNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Returns a CatalogModel identified by the given ObjectPath.
      Parameters:
      modelPath - Path of the model
      Returns:
      The requested model
      Throws:
      org.apache.flink.table.catalog.exceptions.ModelNotExistException - if the target does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • modelExists

      default boolean modelExists(org.apache.flink.table.catalog.ObjectPath modelPath) throws org.apache.flink.table.catalog.exceptions.CatalogException
      Check if a model exists in this catalog.
      Parameters:
      modelPath - Path of the model
      Returns:
      true if the given model exists in the catalog false otherwise
      Throws:
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • dropModel

      default void dropModel(org.apache.flink.table.catalog.ObjectPath modelPath, boolean ignoreIfNotExists) throws org.apache.flink.table.catalog.exceptions.ModelNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Drop a model.
      Parameters:
      modelPath - Path of the model to be dropped
      ignoreIfNotExists - Flag to specify behavior when the model does not exist: if set to false, throw an exception, if set to true, do nothing.
      Throws:
      org.apache.flink.table.catalog.exceptions.ModelNotExistException - if the model does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • renameModel

      default void renameModel(org.apache.flink.table.catalog.ObjectPath modelPath, String newModelName, boolean ignoreIfNotExists) throws org.apache.flink.table.catalog.exceptions.ModelNotExistException, org.apache.flink.table.catalog.exceptions.ModelAlreadyExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Rename an existing model.
      Parameters:
      modelPath - Path of the model to be renamed
      newModelName - the new name of the model
      ignoreIfNotExists - Flag to specify behavior when the model does not exist: if set to false, throw an exception, if set to true, do nothing.
      Throws:
      org.apache.flink.table.catalog.exceptions.ModelNotExistException - if the model does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
      org.apache.flink.table.catalog.exceptions.ModelAlreadyExistException
    • createModel

      default void createModel(org.apache.flink.table.catalog.ObjectPath modelPath, CatalogModel model, boolean ignoreIfExists) throws org.apache.flink.table.catalog.exceptions.ModelAlreadyExistException, org.apache.flink.table.catalog.exceptions.DatabaseNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Creates a new model.

      The framework will make sure to call this method with fully validated ResolvedCatalogModel. Those instances are easy to serialize for a durable catalog implementation.

      Parameters:
      modelPath - path of the model to be created
      model - the CatalogModel definition
      ignoreIfExists - flag to specify behavior when a model already exists at the given path: if set to false, it throws a ModelAlreadyExistException, if set to true, do nothing.
      Throws:
      org.apache.flink.table.catalog.exceptions.ModelAlreadyExistException - if model already exists and ignoreIfExists is false
      org.apache.flink.table.catalog.exceptions.DatabaseNotExistException - if the database in tablePath doesn't exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • alterModel

      default void alterModel(org.apache.flink.table.catalog.ObjectPath modelPath, CatalogModel newModel, boolean ignoreIfNotExists) throws org.apache.flink.table.catalog.exceptions.ModelNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Modifies an existing model.

      The framework will make sure to call this method with fully validated ResolvedCatalogModel. Those instances are easy to serialize for a durable catalog implementation.

      Parameters:
      modelPath - path of the model to be modified
      newModel - the new model definition
      ignoreIfNotExists - flag to specify behavior when the model does not exist: if set to false, throw an exception, if set to true, do nothing.
      Throws:
      org.apache.flink.table.catalog.exceptions.ModelNotExistException - if the model does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception
    • alterModel

      default void alterModel(org.apache.flink.table.catalog.ObjectPath modelPath, CatalogModel newModel, List<org.apache.flink.table.catalog.ModelChange> modelChanges, boolean ignoreIfNotExists) throws org.apache.flink.table.catalog.exceptions.ModelNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException
      Modifies an existing model.

      The framework will make sure to call this method with fully validated ResolvedCatalogModel. Those instances are easy to serialize for a durable catalog implementation.

      Parameters:
      modelPath - path of the model to be modified
      newModel - the new model definition
      modelChanges - changes to describe the modification between the newModel and the original model
      ignoreIfNotExists - flag to specify behavior when the model does not exist: if set to false, throw an exception, if set to true, do nothing.
      Throws:
      org.apache.flink.table.catalog.exceptions.ModelNotExistException - if the model does not exist
      org.apache.flink.table.catalog.exceptions.CatalogException - in case of any runtime exception