trait ViewCatalog extends CatalogPlugin
Catalog API for connectors that expose views.
Connectors that expose only views implement this interface. Connectors that expose
both tables and views must implement RelationCatalog (which extends both this
interface and TableCatalog and adds the cross-cutting contract for the combined
case); the methods on this interface remain view-only -- they do not interact with tables.
The presence of ViewCatalog on the catalog plugin is the signal that it
supports views; there is no capability flag to declare.
- Annotations
- @Evolving()
- Source
- ViewCatalog.java
- Since
4.2.0
- Alphabetic
- By Inheritance
- ViewCatalog
- CatalogPlugin
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def createView(ident: Identifier, info: View): View
Create a view.
Create a view.
- ident
the view identifier
- info
the view metadata
- returns
the metadata of the newly created view; may equal
info
- Exceptions thrown
NoSuchNamespaceExceptionif the identifier's namespace does not exist (optional)ViewAlreadyExistsExceptionif a view already exists atident
- abstract def dropView(ident: Identifier): Boolean
Drop a view.
Drop a view.
- ident
a view identifier
- returns
true if a view was dropped, false otherwise
- abstract def initialize(name: String, options: CaseInsensitiveStringMap): Unit
Called to initialize configuration.
Called to initialize configuration.
This method is called once, just after the provider is instantiated.
- name
the name used to identify and load this catalog
- options
a case-insensitive string map of configuration
- Definition Classes
- CatalogPlugin
- abstract def listViews(namespace: Array[String]): Array[Identifier]
List the views in a namespace from the catalog.
List the views in a namespace from the catalog.
- namespace
a multi-part namespace
- returns
an array of identifiers for views
- Exceptions thrown
NoSuchNamespaceExceptionif the namespace does not exist (optional)
- abstract def loadView(ident: Identifier): View
Load view metadata by identifier.
Load view metadata by identifier.
- ident
a view identifier
- returns
the view metadata
- Exceptions thrown
NoSuchViewExceptionif the view does not exist
- abstract def name(): String
Called to get this catalog's name.
Called to get this catalog's name.
This method is only called after
#initialize(String,CaseInsensitiveStringMap)is called to pass the catalog's name.- Definition Classes
- CatalogPlugin
- abstract def renameView(oldIdent: Identifier, newIdent: Identifier): Unit
Rename a view.
Rename a view.
If the catalog supports tables and contains a table at the new identifier, this must throw
ViewAlreadyExistsException. If the source identifier resolves to a table rather than a view, this must throwNoSuchViewException. The cross-type contract for catalogs that expose both tables and views lives onRelationCatalog.- oldIdent
the view identifier of the existing view to rename
- newIdent
the new view identifier
- Exceptions thrown
NoSuchViewExceptionif no view exists atoldIdentViewAlreadyExistsExceptionif a view (or, in aRelationCatalog, a table) already exists atnewIdent
- abstract def replaceView(ident: Identifier, info: View): View
Atomically replace an existing view's metadata.
Atomically replace an existing view's metadata.
Used by
ALTER VIEW ... AS. Implementations should commit the new metadata atomically; views carry no data, so a single transactional metastore call (or equivalent) is sufficient -- there is no separate staging API.- ident
the view identifier
- info
the new view metadata
- returns
the metadata of the replaced view; may equal
info
- Exceptions thrown
NoSuchViewExceptionif no view exists atident
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- def createOrReplaceView(ident: Identifier, info: View): View
Create a view if one does not exist at
ident, or atomically replace it if one does.Create a view if one does not exist at
ident, or atomically replace it if one does.Used by
CREATE OR REPLACE VIEW. The default implementation calls#replaceView, falling back to#createViewonNoSuchViewException. The fallback is non-atomic across the two calls (a concurrent drop or create can race), so catalogs that can answer the upsert in a single transactional call should override this method to collapse to one RPC and to make the swap atomic.- ident
the view identifier
- info
the view metadata
- returns
the metadata of the created or replaced view; may equal
info
- Exceptions thrown
NoSuchNamespaceExceptionif the identifier's namespace does not exist (optional)ViewAlreadyExistsExceptionifidentcannot host this view -- either a concurrentCREATE VIEWwon the race in the default impl's gap between#replaceViewand the fallback#createView, or, in aRelationCatalog, a table sits atident
- def defaultNamespace(): Array[String]
Return a default namespace for the catalog.
Return a default namespace for the catalog.
When this catalog is set as the current catalog, the namespace returned by this method will be set as the current namespace.
The namespace returned by this method is not required to exist.
- returns
a multi-part namespace
- Definition Classes
- CatalogPlugin
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def invalidateView(ident: Identifier): Unit
Invalidate cached metadata for a view.
Invalidate cached metadata for a view.
If the view is currently cached, drop the cached entry; otherwise do nothing. This must not issue remote calls.
- ident
a view identifier
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def viewExists(ident: Identifier): Boolean
Test whether a view exists.
Test whether a view exists.
The default implementation calls
#loadViewand catchesNoSuchViewException. Catalogs that can answer existence cheaply should override.- ident
a view identifier
- returns
true if a view exists at
ident, false otherwise
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)