Impala - Show Tables



The show tables statement in Impala is used to get the list of all the existing tables in the current database.

Example

Following is an example of the show tables statement. If you want to get the list of tables in a particular database, first of all, change the context to the required database and get the list of tables in it using show tables statement as shown below.

[quickstart.cloudera:21000] > use my_db; 
Query: use my_db
[quickstart.cloudera:21000] > show tables;

On executing the above query, Impala fetches the list of all the tables in the specified database and displays it as shown below.

Query: show tables 
+-----------+ 
| name      | 
+-----------+ 
| customers | 
| employee  | 
+-----------+ 
Fetched 2 row(s) in 0.10s

Listing the Tables using Hue

Open impala Query editor, select the context as my_db and type the show tables statement in it and click on the execute button as shown in the following screenshot.

Listing the Tables

After executing the query, if you scroll down and select the Results tab, you can see the list of the tables as shown below.

Listing the Tables Results
Advertisements