Package org.apache.iceberg.flink
Class FlinkCatalog
java.lang.Object
org.apache.flink.table.catalog.AbstractCatalog
org.apache.iceberg.flink.FlinkCatalog
- All Implemented Interfaces:
- org.apache.flink.table.catalog.Catalog
public class FlinkCatalog
extends org.apache.flink.table.catalog.AbstractCatalog
A Flink Catalog implementation that wraps an Iceberg 
Catalog.
 The mapping between Flink database and Iceberg namespace: Supplying a base namespace for a given catalog, so if you have a catalog that supports a 2-level namespace, you would supply the first level in the catalog configuration and the second level would be exposed as Flink databases.
The Iceberg table manages its partitions by itself. The partition of the Iceberg table is independent of the partition of Flink.
- 
Constructor SummaryConstructorsConstructorDescriptionFlinkCatalog(String catalogName, String defaultDatabase, Namespace baseNamespace, CatalogLoader catalogLoader, boolean cacheEnabled, long cacheExpirationIntervalMs) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidalterDatabase(String name, org.apache.flink.table.catalog.CatalogDatabase newDatabase, boolean ignoreIfNotExists) voidalterFunction(org.apache.flink.table.catalog.ObjectPath functionPath, org.apache.flink.table.catalog.CatalogFunction newFunction, boolean ignoreIfNotExists) voidalterPartition(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec, org.apache.flink.table.catalog.CatalogPartition newPartition, boolean ignoreIfNotExists) voidalterPartitionColumnStatistics(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec, org.apache.flink.table.catalog.stats.CatalogColumnStatistics columnStatistics, boolean ignoreIfNotExists) voidalterPartitionStatistics(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec, org.apache.flink.table.catalog.stats.CatalogTableStatistics partitionStatistics, boolean ignoreIfNotExists) voidalterTable(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogBaseTable newTable, boolean ignoreIfNotExists) This alterTable API only supports altering table properties.voidalterTable(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogBaseTable newTable, List<org.apache.flink.table.catalog.TableChange> tableChanges, boolean ignoreIfNotExists) voidalterTableColumnStatistics(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.stats.CatalogColumnStatistics columnStatistics, boolean ignoreIfNotExists) voidalterTableStatistics(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.stats.CatalogTableStatistics tableStatistics, boolean ignoreIfNotExists) catalog()voidclose()voidcreateDatabase(String name, org.apache.flink.table.catalog.CatalogDatabase database, boolean ignoreIfExists) voidcreateFunction(org.apache.flink.table.catalog.ObjectPath functionPath, org.apache.flink.table.catalog.CatalogFunction function, boolean ignoreIfExists) voidcreatePartition(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec, org.apache.flink.table.catalog.CatalogPartition partition, boolean ignoreIfExists) voidcreateTable(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogBaseTable table, boolean ignoreIfExists) booleandatabaseExists(String databaseName) voiddropDatabase(String name, boolean ignoreIfNotExists, boolean cascade) voiddropFunction(org.apache.flink.table.catalog.ObjectPath functionPath, boolean ignoreIfNotExists) voiddropPartition(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec, boolean ignoreIfNotExists) voiddropTable(org.apache.flink.table.catalog.ObjectPath tablePath, boolean ignoreIfNotExists) booleanfunctionExists(org.apache.flink.table.catalog.ObjectPath functionPath) org.apache.flink.table.catalog.CatalogDatabasegetDatabase(String databaseName) Optional<org.apache.flink.table.factories.Factory> org.apache.flink.table.catalog.CatalogFunctiongetFunction(org.apache.flink.table.catalog.ObjectPath functionPath) org.apache.flink.table.catalog.CatalogPartitiongetPartition(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec) org.apache.flink.table.catalog.stats.CatalogColumnStatisticsgetPartitionColumnStatistics(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec) org.apache.flink.table.catalog.stats.CatalogTableStatisticsgetPartitionStatistics(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec) org.apache.flink.table.catalog.CatalogTablegetTable(org.apache.flink.table.catalog.ObjectPath tablePath) org.apache.flink.table.catalog.stats.CatalogColumnStatisticsgetTableColumnStatistics(org.apache.flink.table.catalog.ObjectPath tablePath) org.apache.flink.table.catalog.stats.CatalogTableStatisticsgetTableStatistics(org.apache.flink.table.catalog.ObjectPath tablePath) listFunctions(String dbName) List<org.apache.flink.table.catalog.CatalogPartitionSpec> listPartitions(org.apache.flink.table.catalog.ObjectPath tablePath) List<org.apache.flink.table.catalog.CatalogPartitionSpec> listPartitions(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec) List<org.apache.flink.table.catalog.CatalogPartitionSpec> listPartitionsByFilter(org.apache.flink.table.catalog.ObjectPath tablePath, List<org.apache.flink.table.expressions.Expression> filters) listTables(String databaseName) voidopen()booleanpartitionExists(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec) voidrenameTable(org.apache.flink.table.catalog.ObjectPath tablePath, String newTableName, boolean ignoreIfNotExists) booleantableExists(org.apache.flink.table.catalog.ObjectPath tablePath) Methods inherited from class org.apache.flink.table.catalog.AbstractCataloggetDefaultDatabase, getNameMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.table.catalog.CatalogbulkGetPartitionColumnStatistics, bulkGetPartitionStatistics, dropDatabase, getFunctionDefinitionFactory, getProcedure, getTable, getTableFactory, listProcedures, supportsManagedTable
- 
Constructor Details- 
FlinkCatalogpublic FlinkCatalog(String catalogName, String defaultDatabase, Namespace baseNamespace, CatalogLoader catalogLoader, boolean cacheEnabled, long cacheExpirationIntervalMs) 
 
- 
- 
Method Details- 
openpublic void open() throws org.apache.flink.table.catalog.exceptions.CatalogException- Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
closepublic void close() throws org.apache.flink.table.catalog.exceptions.CatalogException- Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
catalog
- 
listDatabasespublic List<String> listDatabases() throws org.apache.flink.table.catalog.exceptions.CatalogException- Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
getDatabasepublic org.apache.flink.table.catalog.CatalogDatabase getDatabase(String databaseName) throws org.apache.flink.table.catalog.exceptions.DatabaseNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.DatabaseNotExistException
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
databaseExistspublic boolean databaseExists(String databaseName) throws org.apache.flink.table.catalog.exceptions.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
createDatabasepublic 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 - Throws:
- org.apache.flink.table.catalog.exceptions.DatabaseAlreadyExistException
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
dropDatabasepublic 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 - Throws:
- org.apache.flink.table.catalog.exceptions.DatabaseNotExistException
- org.apache.flink.table.catalog.exceptions.DatabaseNotEmptyException
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
alterDatabasepublic 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 - Throws:
- org.apache.flink.table.catalog.exceptions.DatabaseNotExistException
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
listTablespublic List<String> listTables(String databaseName) throws org.apache.flink.table.catalog.exceptions.DatabaseNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.DatabaseNotExistException
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
getTablepublic org.apache.flink.table.catalog.CatalogTable getTable(org.apache.flink.table.catalog.ObjectPath tablePath) throws org.apache.flink.table.catalog.exceptions.TableNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.TableNotExistException
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
tableExistspublic boolean tableExists(org.apache.flink.table.catalog.ObjectPath tablePath) throws org.apache.flink.table.catalog.exceptions.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
dropTablepublic 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 - Throws:
- org.apache.flink.table.catalog.exceptions.TableNotExistException
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
renameTablepublic 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 - Throws:
- org.apache.flink.table.catalog.exceptions.TableNotExistException
- org.apache.flink.table.catalog.exceptions.TableAlreadyExistException
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
createTablepublic 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.CatalogException, org.apache.flink.table.catalog.exceptions.TableAlreadyExistException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
- org.apache.flink.table.catalog.exceptions.TableAlreadyExistException
 
- 
alterTablepublic 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.CatalogException, org.apache.flink.table.catalog.exceptions.TableNotExistException This alterTable API only supports altering table properties.Support for adding/removing/renaming columns cannot be done by comparing CatalogTable instances, unless the Flink schema contains Iceberg column IDs. To alter columns, use the other alterTable API and provide a list of TableChange's. - 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.CatalogException- in case of any runtime exception
- org.apache.flink.table.catalog.exceptions.TableNotExistException- if the table does not exist
 
- 
alterTablepublic 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 - Throws:
- org.apache.flink.table.catalog.exceptions.TableNotExistException
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
getFactory
- 
listViewspublic List<String> listViews(String databaseName) throws org.apache.flink.table.catalog.exceptions.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
getPartitionpublic 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.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
partitionExistspublic boolean partitionExists(org.apache.flink.table.catalog.ObjectPath tablePath, org.apache.flink.table.catalog.CatalogPartitionSpec partitionSpec) throws org.apache.flink.table.catalog.exceptions.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
createPartitionpublic 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.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
dropPartitionpublic 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.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
alterPartitionpublic 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.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
listFunctionspublic List<String> listFunctions(String dbName) throws org.apache.flink.table.catalog.exceptions.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
getFunctionpublic org.apache.flink.table.catalog.CatalogFunction getFunction(org.apache.flink.table.catalog.ObjectPath functionPath) throws org.apache.flink.table.catalog.exceptions.FunctionNotExistException, org.apache.flink.table.catalog.exceptions.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.FunctionNotExistException
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
functionExistspublic boolean functionExists(org.apache.flink.table.catalog.ObjectPath functionPath) throws org.apache.flink.table.catalog.exceptions.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
createFunctionpublic void createFunction(org.apache.flink.table.catalog.ObjectPath functionPath, org.apache.flink.table.catalog.CatalogFunction function, boolean ignoreIfExists) throws org.apache.flink.table.catalog.exceptions.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
alterFunctionpublic void alterFunction(org.apache.flink.table.catalog.ObjectPath functionPath, org.apache.flink.table.catalog.CatalogFunction newFunction, boolean ignoreIfNotExists) throws org.apache.flink.table.catalog.exceptions.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
dropFunctionpublic void dropFunction(org.apache.flink.table.catalog.ObjectPath functionPath, boolean ignoreIfNotExists) throws org.apache.flink.table.catalog.exceptions.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
alterTableStatisticspublic 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.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
alterTableColumnStatisticspublic 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.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
alterPartitionStatisticspublic 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.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
alterPartitionColumnStatisticspublic 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.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
listPartitionspublic 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 - Throws:
- org.apache.flink.table.catalog.exceptions.TableNotExistException
- org.apache.flink.table.catalog.exceptions.TableNotPartitionedException
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
listPartitionspublic 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.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
listPartitionsByFilterpublic List<org.apache.flink.table.catalog.CatalogPartitionSpec> listPartitionsByFilter(org.apache.flink.table.catalog.ObjectPath tablePath, List<org.apache.flink.table.expressions.Expression> filters) throws org.apache.flink.table.catalog.exceptions.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
getTableStatisticspublic org.apache.flink.table.catalog.stats.CatalogTableStatistics getTableStatistics(org.apache.flink.table.catalog.ObjectPath tablePath) throws org.apache.flink.table.catalog.exceptions.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
getTableColumnStatisticspublic org.apache.flink.table.catalog.stats.CatalogColumnStatistics getTableColumnStatistics(org.apache.flink.table.catalog.ObjectPath tablePath) throws org.apache.flink.table.catalog.exceptions.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
getPartitionStatisticspublic 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.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
- 
getPartitionColumnStatisticspublic 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.CatalogException - Throws:
- org.apache.flink.table.catalog.exceptions.CatalogException
 
 
-