public class BaseViewSessionCatalog.AsViewCatalog extends java.lang.Object implements 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.
|
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.
|
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.
|
boolean |
viewExists(TableIdentifier identifier)
Check whether view exists.
|
public java.lang.String name()
ViewCatalog
name
in interface ViewCatalog
public java.util.List<TableIdentifier> listViews(Namespace namespace)
ViewCatalog
listViews
in interface ViewCatalog
namespace
- a namespacepublic View loadView(TableIdentifier identifier)
ViewCatalog
loadView
in interface ViewCatalog
identifier
- a view identifierView
implementation referred by the identifierpublic boolean viewExists(TableIdentifier identifier)
ViewCatalog
viewExists
in interface ViewCatalog
identifier
- a view identifierpublic ViewBuilder buildView(TableIdentifier identifier)
ViewCatalog
buildView
in interface ViewCatalog
identifier
- a view identifierpublic boolean dropView(TableIdentifier identifier)
ViewCatalog
dropView
in interface ViewCatalog
identifier
- a view identifierpublic void renameView(TableIdentifier from, TableIdentifier to)
ViewCatalog
renameView
in interface ViewCatalog
from
- identifier of the view to renameto
- new view identifierpublic void invalidateView(TableIdentifier identifier)
ViewCatalog
If the view is already loaded or cached, drop cached data. If the view does not exist or is not cached, do nothing.
invalidateView
in interface ViewCatalog
identifier
- a view identifierpublic void initialize(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> properties)
ViewCatalog
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.
initialize
in interface ViewCatalog
name
- a custom name for the catalogproperties
- catalog properties