class View extends Relation
A view in a catalog -- the typed payload returned by ViewCatalog#loadView and accepted
by ViewCatalog#createView / ViewCatalog#replaceView. A View carries the
view-specific fields that cannot be represented as string table properties: the query text,
captured creation-time resolution context, captured SQL configs, schema-binding mode, and
query output column names. Columns and user TBLPROPERTIES are set via the typed builder.
Unlike a Table, a View is itself a Relation rather than something Spark
realizes into a Table: Spark expands the view's query text at read time and never builds
a view object. A RelationCatalog returns a View directly from
RelationCatalog#loadRelation for a view identifier, so it never has to smuggle a view
through the Table surface.
- Annotations
- @Evolving()
- Source
- View.java
- Since
4.2.0
- Alphabetic
- By Inheritance
- View
- Relation
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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 columns(): Array[Column]
The columns of this relation.
- def currentCatalog(): String
The current catalog at the time the view was created, used to resolve unqualified identifiers in
#queryText()at read time.The current catalog at the time the view was created, used to resolve unqualified identifiers in
#queryText()at read time. May benullif the view was created with no captured resolution context. - def currentNamespace(): Array[String]
The current namespace at the time the view was created, used alongside
#currentCatalog()to resolve unqualified identifiers in#queryText()at read time.The current namespace at the time the view was created, used alongside
#currentCatalog()to resolve unqualified identifiers in#queryText()at read time. Nevernull; empty when no namespace was captured. - 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()
- 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()
- def properties(): Map[String, String]
The string map of properties of this relation.
- def queryColumnNames(): Array[String]
Output column names of the query that created the view, used to map the query output to the view's declared columns during view resolution.
Output column names of the query that created the view, used to map the query output to the view's declared columns during view resolution. Empty for views in
EVOLUTIONmode, which always use the view's current schema. - def queryText(): String
The SQL text of the view.
- def schema(): StructType
- def schemaMode(): String
The view's schema binding mode.
The view's schema binding mode. Allowed values match the
toStringform oforg.apache.spark.sql.catalyst.analysis.ViewSchemaMode:BINDING,COMPENSATION,TYPE EVOLUTION,EVOLUTION. May benullwhen schema binding is not configured. - def sqlConfigs(): Map[String, String]
The SQL configs captured at view creation time, applied when parsing and analyzing the view body.
The SQL configs captured at view creation time, applied when parsing and analyzing the view body. Keys are unprefixed SQL config names (e.g.
spark.sql.ansi.enabled). - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def viewDependencies(): DependencyList
Returns the structured list of objects this view depends on (source tables and functions), or
nullif no dependency list was supplied.Returns the structured list of objects this view depends on (source tables and functions), or
nullif no dependency list was supplied. Unlike other view metadata which is encoded into#properties(), dependency lists are a first-class field because their nested structure does not round-trip cleanly through flat string properties. - 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)