Packages

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

Linear Supertypes
CatalogPlugin, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ViewCatalog
  2. CatalogPlugin
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. 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

    NoSuchNamespaceException if the identifier's namespace does not exist (optional)

    ViewAlreadyExistsException if a view already exists at ident

  2. 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

  3. 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
  4. 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

    NoSuchNamespaceException if the namespace does not exist (optional)

  5. 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

    NoSuchViewException if the view does not exist

  6. 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
  7. 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 throw NoSuchViewException. The cross-type contract for catalogs that expose both tables and views lives on RelationCatalog.

    oldIdent

    the view identifier of the existing view to rename

    newIdent

    the new view identifier

    Exceptions thrown

    NoSuchViewException if no view exists at oldIdent

    ViewAlreadyExistsException if a view (or, in a RelationCatalog, a table) already exists at newIdent

  8. 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

    NoSuchViewException if no view exists at ident

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  6. 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 #createView on NoSuchViewException. 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

    NoSuchNamespaceException if the identifier's namespace does not exist (optional)

    ViewAlreadyExistsException if ident cannot host this view -- either a concurrent CREATE VIEW won the race in the default impl's gap between #replaceView and the fallback #createView, or, in a RelationCatalog, a table sits at ident

  7. 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
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  12. 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

  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  17. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  18. def toString(): String
    Definition Classes
    AnyRef → Any
  19. def viewExists(ident: Identifier): Boolean

    Test whether a view exists.

    Test whether a view exists.

    The default implementation calls #loadView and catches NoSuchViewException. Catalogs that can answer existence cheaply should override.

    ident

    a view identifier

    returns

    true if a view exists at ident, false otherwise

  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from CatalogPlugin

Inherited from AnyRef

Inherited from Any

Ungrouped