public interface ViewCatalog
Modifier and Type | Method and Description |
---|---|
ViewBuilder |
buildView(TableIdentifier identifier)
Instantiate a builder to create or replace a SQL view.
|
boolean |
dropView(TableIdentifier identifier)
Drop a view.
|
default 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.
|
default void |
invalidateView(TableIdentifier identifier)
Invalidate cached view metadata from current catalog.
|
java.util.List<TableIdentifier> |
listViews(Namespace namespace)
Return all the identifiers under this namespace.
|
View |
loadView(TableIdentifier identifier)
Load a view.
|
java.lang.String |
name()
Return the name for this catalog.
|
void |
renameView(TableIdentifier from,
TableIdentifier to)
Rename a view.
|
default boolean |
viewExists(TableIdentifier identifier)
Check whether view exists.
|
java.lang.String name()
java.util.List<TableIdentifier> listViews(Namespace namespace)
namespace
- a namespaceNoSuchNamespaceException
- if the namespace is not foundView loadView(TableIdentifier identifier)
identifier
- a view identifierView
implementation referred by the identifierNoSuchViewException
- if the view does not existdefault boolean viewExists(TableIdentifier identifier)
identifier
- a view identifierViewBuilder buildView(TableIdentifier identifier)
identifier
- a view identifierboolean dropView(TableIdentifier identifier)
identifier
- a view identifiervoid renameView(TableIdentifier from, TableIdentifier to)
from
- identifier of the view to renameto
- new view identifierNoSuchViewException
- if the "from" view does not existAlreadyExistsException
- if the "to" view already existsdefault void invalidateView(TableIdentifier identifier)
If the view is already loaded or cached, drop cached data. If the view does not exist or is not cached, do nothing.
identifier
- a view identifierdefault void initialize(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> 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.
name
- a custom name for the catalogproperties
- catalog properties