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:
HiveCatalog
,InMemoryCatalog
,JdbcCatalog
,NessieCatalog
public abstract class BaseMetastoreViewCatalog extends BaseMetastoreCatalog implements ViewCatalog
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
BaseMetastoreViewCatalog.BaseMetastoreViewCatalogTableBuilder
The purpose of this class is to add view detection when replacing a tableprotected class
BaseMetastoreViewCatalog.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.TableBuilder
buildTable(TableIdentifier identifier, Schema schema)
/** Instantiate a builder to either create a table or start a create/replace transaction.ViewBuilder
buildView(TableIdentifier identifier)
Instantiate a builder to create or replace a SQL view.void
initialize(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.View
loadView(TableIdentifier identifier)
Load a view.java.lang.String
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
-
-
-
-
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: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
public java.lang.String 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
public View loadView(TableIdentifier identifier)
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
public ViewBuilder buildView(TableIdentifier identifier)
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
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:
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
-
-