Manage Data Catalog views - Amazon Athena
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Manage Data Catalog views

You can use DDL commands to update and manage your Data Catalog views.

Update a Data Catalog view

The Lake Formation admin or definer can use the ALTER VIEW UPDATE DIALECT syntax to update the view definition. The following example modifies the view definition to select columns from the returns table instead of the orders table.

ALTER VIEW orders_by_date UPDATE DIALECT AS SELECT return_date, sum(totalprice) AS price FROM returns WHERE order_city = 'SEATTLE' GROUP BY orderdate

Supported DDL actions for Amazon Glue Data Catalog views

Athena supports the following actions for Amazon Glue Data Catalog views.

Statement Description
ALTER VIEW DIALECT

Updates a Data Catalog view by either adding an engine dialect or by updating or dropping an existing engine dialect.

CREATE PROTECTED MULTI DIALECT VIEW

Creates a Data Catalog view from a specified SELECT query. For more information, see CREATE PROTECTED MULTI DIALECT VIEW.

The optional OR REPLACE clause lets you update the existing view by replacing it.

DESCRIBE VIEW

Shows the list of columns for the named view. This allows you to examine the attributes of a complex view.

DROP VIEW

Deletes an existing view. The optional IF EXISTS clause suppresses the error if the view does not exist.

SHOW CREATE VIEW

Shows the SQL statement that creates the specified view.

SHOW VIEWS

Lists the views in the specified database, or in the current database if you omit the database name. Use the optional LIKE clause with a regular expression to restrict the list of view names. You can also see the list of views in the left pane in the console.

SHOW COLUMNS

Lists the columns in the schema for a view.