CreateViewCommand Logical Command

CreateViewCommand is a logical command for creating a view or a table.

CreateViewCommand is a result of parsing CREATE VIEW (and variants) in SQL and executing Dataset operators: createTempView, createOrReplaceTempView, and createGlobalTempView.

Tip
CreateViewCommand is described by createView labeled alternative in statement expression in SqlBase.g4 and parsed using SparkSqlParser.
Caution
FIXME What’s the difference between CreateTempViewUsing?

CreateViewCommand works with different view types (aka ViewType).

Table 1. CreateViewCommand’s View Types
View Type Description / Side Effect

LocalTempView

A session-scoped local temporary view. Available until the session that has created it stops.

When executed, CreateViewCommand requests the current SessionCatalog to create a temporary view.

GlobalTempView

A cross-session global temporary view. Available until a Spark application stops.

When executed, CreateViewCommand requests the current SessionCatalog to create a global view.

PersistedView

A cross-session persisted view. Available until you it is dropped.

When executed, CreateViewCommand checks if the table exists. If it does and replace is enabled CreateViewCommand requests the current SessionCatalog to alter a table. Otherwise, when the table does not exist, CreateViewCommand requests the current SessionCatalog to create it.

run Method

Caution
FIXME

results matching ""

    No results matching ""