Package org.apache.iceberg.view
Class BaseMetastoreViewCatalog
- java.lang.Object
-
- org.apache.iceberg.BaseMetastoreCatalog
-
- org.apache.iceberg.view.BaseMetastoreViewCatalog
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Catalog,ViewCatalog
- Direct Known Subclasses:
InMemoryCatalog,JdbcCatalog,NessieCatalog
public abstract class BaseMetastoreViewCatalog extends BaseMetastoreCatalog implements ViewCatalog
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classBaseMetastoreViewCatalog.BaseMetastoreViewCatalogTableBuilderThe purpose of this class is to add view detection when replacing a tableprotected classBaseMetastoreViewCatalog.BaseViewBuilder-
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
Constructors Constructor Description BaseMetastoreViewCatalog()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Catalog.TableBuilderbuildTable(TableIdentifier identifier, Schema schema)/** Instantiate a builder to either create a table or start a create/replace transaction.ViewBuilderbuildView(TableIdentifier identifier)Instantiate a builder to create or replace a SQL view.voidinitialize(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> properties)Initialize a view catalog given a custom name and a map of catalog properties.ViewloadView(TableIdentifier identifier)Load a view.java.lang.Stringname()Return the name for this catalog.protected abstract ViewOperationsnewViewOps(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
-
-
-
-
Method Detail
-
newViewOps
protected abstract ViewOperations newViewOps(TableIdentifier identifier)
-
initialize
public void initialize(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> properties)Description copied from interface:ViewCatalogInitialize 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:
initializein interfaceCatalog- Specified by:
initializein interfaceViewCatalog- Parameters:
name- a custom name for the catalogproperties- catalog properties
-
name
public java.lang.String name()
Description copied from interface:ViewCatalogReturn the name for this catalog.- Specified by:
namein interfaceCatalog- Specified by:
namein interfaceViewCatalog- Returns:
- this catalog's name
-
loadView
public View loadView(TableIdentifier identifier)
Description copied from interface:ViewCatalogLoad a view.- Specified by:
loadViewin interfaceViewCatalog- Parameters:
identifier- a view identifier- Returns:
- instance of
Viewimplementation referred by the identifier
-
buildView
public ViewBuilder buildView(TableIdentifier identifier)
Description copied from interface:ViewCatalogInstantiate a builder to create or replace a SQL view.- Specified by:
buildViewin interfaceViewCatalog- Parameters:
identifier- a view identifier- Returns:
- a view builder
-
buildTable
public Catalog.TableBuilder buildTable(TableIdentifier identifier, Schema schema)
Description copied from interface:Catalog/** Instantiate a builder to either create a table or start a create/replace transaction.- Specified by:
buildTablein interfaceCatalog- Overrides:
buildTablein classBaseMetastoreCatalog- Parameters:
identifier- a table identifierschema- a schema- Returns:
- the builder to create a table or start a create/replace transaction
-
-