Impala Alter View - Apache Impala

What isImpala Alter View?

The Alter View statement of Impala is used to change a view. Using this statement, you can change the name of a view, change the database, and the query associated with it.

Since a view is a logical construct, no physical data will be affected by the alter view query.

Syntax

Following is the syntax of the Alter View statement

Example

For example, assume we have a view named customers_view in the my_db database in Impala with the following contents.

Following is an example of Alter View Statement. In this example, we are including the columns id, name, and salary instead of name and age to the customers_view.

On executing the above query, Impala does the specified changes to the customers_view, displaying the following message.

Query: alter view customers_view as select id, name, salary from customers

Verification

You can verify the contents of the view named customers_view, using the select statement as shown below.

This will produce the following result.

Altering a View using Hue

Open Impala Query editor, select the context as my_db, and type the Alter View statement in it and click on the execute button as shown in the following screenshot.

altering_a_view

After executing the query, the view named sample will be altered accordingly.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Apache Impala Topics