Package org.apache.iceberg.view
Class BaseMetastoreViewCatalog
java.lang.Object
org.apache.iceberg.BaseMetastoreCatalog
org.apache.iceberg.view.BaseMetastoreViewCatalog
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Catalog
,ViewCatalog
- Direct Known Subclasses:
InMemoryCatalog
,JdbcCatalog
,NessieCatalog
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
The purpose of this class is to add view detection when replacing a tableprotected class
Nested classes/interfaces inherited from class org.apache.iceberg.BaseMetastoreCatalog
BaseMetastoreCatalog.BaseMetastoreCatalogTableBuilder
Nested classes/interfaces inherited from interface org.apache.iceberg.catalog.Catalog
Catalog.TableBuilder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuildTable
(TableIdentifier identifier, Schema schema) /** Instantiate a builder to either create a table or start a create/replace transaction.buildView
(TableIdentifier identifier) Instantiate a builder to create or replace a SQL view.void
initialize
(String name, Map<String, String> properties) Initialize a view catalog given a custom name and a map of catalog properties.loadView
(TableIdentifier identifier) Load a view.name()
Return the name for this catalog.protected abstract ViewOperations
newViewOps
(TableIdentifier identifier) Methods inherited from class org.apache.iceberg.BaseMetastoreCatalog
close, defaultWarehouseLocation, fullTableName, isValidIdentifier, loadTable, metricsReporter, newTableOps, properties, registerTable, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.iceberg.catalog.Catalog
createTable, createTable, createTable, createTable, dropTable, dropTable, invalidateTable, listTables, newCreateTableTransaction, newCreateTableTransaction, newCreateTableTransaction, newCreateTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, renameTable, tableExists
Methods inherited from interface org.apache.iceberg.catalog.ViewCatalog
dropView, invalidateView, listViews, renameView, viewExists
-
Constructor Details
-
BaseMetastoreViewCatalog
public BaseMetastoreViewCatalog()
-
-
Method Details
-
newViewOps
-
initialize
Description copied from interface:ViewCatalog
Initialize a view catalog given a custom name and a map of catalog properties.A custom view catalog implementation must have a no-arg constructor. A compute engine like Spark or Flink will first initialize the catalog without any arguments, and then call this method to complete catalog initialization with properties passed into the engine.
- Specified by:
initialize
in interfaceCatalog
- Specified by:
initialize
in interfaceViewCatalog
- Parameters:
name
- a custom name for the catalogproperties
- catalog properties
-
name
Description copied from interface:ViewCatalog
Return the name for this catalog.- Specified by:
name
in interfaceCatalog
- Specified by:
name
in interfaceViewCatalog
- Returns:
- this catalog's name
-
loadView
Description copied from interface:ViewCatalog
Load a view.- Specified by:
loadView
in interfaceViewCatalog
- Parameters:
identifier
- a view identifier- Returns:
- instance of
View
implementation referred by the identifier
-
buildView
Description copied from interface:ViewCatalog
Instantiate a builder to create or replace a SQL view.- Specified by:
buildView
in interfaceViewCatalog
- Parameters:
identifier
- a view identifier- Returns:
- a view builder
-
buildTable
Description copied from interface:Catalog
/** Instantiate a builder to either create a table or start a create/replace transaction.- Specified by:
buildTable
in interfaceCatalog
- Overrides:
buildTable
in classBaseMetastoreCatalog
- Parameters:
identifier
- a table identifierschema
- a schema- Returns:
- the builder to create a table or start a create/replace transaction
-