- Impala - Query Language Basics
- Impala - Shell
- Impala - Architecture
- Impala - Environment
- Impala - Overview
- Impala - Home
Database Specific Statements
Table Specific Statements
- Impala - Drop a View
- Impala - Alter View
- Impala - Create View
- Impala - Show Tables
- Impala - Truncate a Table
- Impala - Drop a Table
- Impala - Alter Table
- Impala - Describe Statement
- Impala - Select Statement
- Impala - Insert Statement
- Impala - Create Table Statement
Impala - Clauses
- Impala - Distinct Operator
- Impala - With Clause
- Impala - Union Clause
- Impala - Offset Clause
- Impala - Limit Clause
- Impala - Having Clause
- Impala - Group By Clause
- Impala - Order By Clause
Impala Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Impala - Drop a View
The Drop View query of Impala is used to delete an existing view. Since a view is a logical construct, no physical data will be affected by the drop view query.
Syntax
Following is the syntax of the drop view statement.
DROP VIEW database_name.view_name;
Example
For example, assume we have a view named customers_view in the my_db database in Impala with the following contents.
+----------+-----+ | name | age | +----------+-----+ | Komal | 22 | | Khilan | 25 | | Ramesh | 32 | | Hardik | 27 | | Chaitap | 25 | | kaushik | 23 | +----------+-----+
Following is an example of Drop View Statement. In this example, we are trying to delete the view named customers_view using the drop view query.
[quickstart.cloudera:21000] > Drop view customers_view;
On executing the above query, Impala deletes the specified view, displaying the following message.
Query: drop view customers_view
Verification
If you verify the pst of tables using show tables statement, you can observe that the view named customers_view is deleted.
[quickstart.cloudera:21000] > show tables;
This will produce the following result.
Query: show tables +-----------+ | name | +-----------+ | customers | | employee | | sample | +-----------+ Fetched 3 row(s) in 0.10s
Dropping a View using Hue
Open Impala Query editor, select the context as my_db, and type the Drop view statement in it and cpck on the execute button as shown in the following screenshot.
After executing the query, if you scroll down, you can see a pst named TABLES. This pst contains all the tables and views in the current database. From this pst, you can find that the specified view was deleted.
Advertisements