ALTER VIEW

    RENAME View

    Renames the existing view. If the new view name already exists in the source database, a TableAlreadyExistsException is thrown. This operation does not support moving the views across databases.

    If the view is cached, the command clears cached data of the view and all its dependents that refer to it. View’s cache will be lazily filled when the next time the view is accessed. The command leaves view’s dependents as uncached.

    Syntax

    Parameters

    • view_identifier

      Specifies a view name, which may be optionally qualified with a database name.

      Syntax: [ database_name. ] view_name

    SET View Properties

    Set one or more properties of an existing view. The properties are the key value pairs. If the properties’ keys exist, the values are replaced with the new values. If the properties’ keys do not exist, the key value pairs are added into the properties.

    Syntax

    Parameters

    • view_identifier

      Specifies a view name, which may be optionally qualified with a database name.

    UNSET View Properties

    Drop one or more properties of an existing view. If the specified keys do not exist, an exception is thrown. Use IF EXISTS to avoid the exception.

    Syntax

    Parameters

    • view_identifier

      Specifies a view name, which may be optionally qualified with a database name.

      Syntax: [ database_name. ] view_name

    • property_key

      Syntax: [ key_part1 ] [ .key_part2 ] [ ... ]

    ALTER View AS SELECT

    ALTER VIEW view_identifier AS SELECT statement changes the definition of a view. The statement must be valid, and the view_identifier must exist.

    Syntax

    Note that ALTER VIEW statement does not support SET SERDE or SET SERDEPROPERTIES properties.

    Parameters

    • view_identifier

      Specifies a view name, which may be optionally qualified with a database name.

      Syntax:

    • select_statement

      Specifies the definition of the view. Check for details.