public interface ViewSessionCatalog
Modifier and Type | Method and Description |
---|---|
ViewBuilder |
buildView(SessionCatalog.SessionContext context,
TableIdentifier identifier)
Instantiate a builder to create or replace a SQL view.
|
boolean |
dropView(SessionCatalog.SessionContext context,
TableIdentifier identifier)
Drop a 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.
|
default void |
invalidateView(SessionCatalog.SessionContext context,
TableIdentifier identifier)
Invalidate cached view metadata from current catalog.
|
java.util.List<TableIdentifier> |
listViews(SessionCatalog.SessionContext context,
Namespace namespace)
Return all the identifiers under this namespace.
|
View |
loadView(SessionCatalog.SessionContext context,
TableIdentifier identifier)
Load a view.
|
java.lang.String |
name()
Return the name for this catalog.
|
void |
renameView(SessionCatalog.SessionContext context,
TableIdentifier from,
TableIdentifier to)
Rename a view.
|
default boolean |
viewExists(SessionCatalog.SessionContext context,
TableIdentifier identifier)
Check whether view exists.
|
java.lang.String name()
java.util.List<TableIdentifier> listViews(SessionCatalog.SessionContext context, Namespace namespace)
namespace
- a namespaceNoSuchNamespaceException
- if the namespace is not foundView loadView(SessionCatalog.SessionContext context, TableIdentifier identifier)
identifier
- a view identifierView
implementation referred by the identifierNoSuchViewException
- if the view does not existdefault boolean viewExists(SessionCatalog.SessionContext context, TableIdentifier identifier)
identifier
- a view identifierViewBuilder buildView(SessionCatalog.SessionContext context, TableIdentifier identifier)
identifier
- a view identifierboolean dropView(SessionCatalog.SessionContext context, TableIdentifier identifier)
identifier
- a view identifiervoid renameView(SessionCatalog.SessionContext context, 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 existsNoSuchNamespaceException
- if the "to" namespace doesn't existdefault void invalidateView(SessionCatalog.SessionContext context, 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 identifiervoid 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