Class ViewInfo
Object
org.apache.spark.sql.connector.catalog.TableInfo
org.apache.spark.sql.connector.catalog.ViewInfo
View metadata DTO -- the typed payload returned by
ViewCatalog.loadView(org.apache.spark.sql.connector.catalog.Identifier) and accepted
by ViewCatalog.createView(org.apache.spark.sql.connector.catalog.Identifier, org.apache.spark.sql.connector.catalog.ViewInfo) / ViewCatalog.replaceView(org.apache.spark.sql.connector.catalog.Identifier, org.apache.spark.sql.connector.catalog.ViewInfo). 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. Schema and user TBLPROPERTIES are inherited from TableInfo
via the typed builder.
ViewInfo extends TableInfo so that a TableViewCatalog can opt into the
single-RPC perf path by returning a MetadataTable wrapping a ViewInfo
from TableViewCatalog.loadTableOrView(org.apache.spark.sql.connector.catalog.Identifier) for a view identifier. Pure ViewCatalog
implementations never see TableInfo; the typed setters on ViewInfo.Builder cover
everything they need to construct a ViewInfo.
- Since:
- 4.2.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionThe current catalog at the time the view was created, used to resolve unqualified identifiers inqueryText()at read time.String[]The current namespace at the time the view was created, used alongsidecurrentCatalog()to resolve unqualified identifiers inqueryText()at read time.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.The SQL text of the view.The view's schema binding mode.The SQL configs captured at view creation time, applied when parsing and analyzing the view body.Methods inherited from class org.apache.spark.sql.connector.catalog.TableInfo
columns, constraints, partitions, properties, schema
-
Method Details
-
queryText
The SQL text of the view. -
currentCatalog
The current catalog at the time the view was created, used to resolve unqualified identifiers inqueryText()at read time. May benullif the view was created with no captured resolution context. -
currentNamespace
The current namespace at the time the view was created, used alongsidecurrentCatalog()to resolve unqualified identifiers inqueryText()at read time. Nevernull; empty when no namespace was captured. -
sqlConfigs
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). -
schemaMode
The view's schema binding mode. Allowed values match thetoStringform oforg.apache.spark.sql.catalyst.analysis.ViewSchemaMode:BINDING,COMPENSATION,TYPE EVOLUTION,EVOLUTION. May benullwhen schema binding is not configured. -
queryColumnNames
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 inEVOLUTIONmode, which always use the view's current schema.
-