Impala - Describe Statement


Advertisements


The describe statement in Impala is used to give the description of the table. The result of this statement contains the information about a table such as the column names and their data types.

Syntax

Following is the syntax of the Impala describe statement.

Describe table_name;

Example

For example, assume we have a table named customer in Impala, with the following data −

ID    NAME     AGE    ADDRESS     SALARY
--- --------- ----- ----------- -----------
1   Ramesh     32    Ahmedabad    20000
2   Khilan     25    Delhi        15000
3   Hardik     27    Bhopal       40000
4   Chaitali   25    Mumbai       35000
5   kaushik    23    Kota         30000
6   Komal      22    Mp           32000

You can get the description of the customer table using the describe statement as shown below −

[quickstart.cloudera:21000] > describe customer;

On executing the above query, Impala fetches the metadata of the specified table and displays it as shown below.

Query: describe customer
 
+---------+--------+---------+ 
| name    | type   | comment | 
+---------+--------+---------+ 
| id      | int    |         |                    
| name    | string |         | 
| age     | int    |         | 
| address | string |         | 
| salary  | bigint |         |
+---------+--------+---------+ 

Fetched 5 row(s) in 0.51s

Describing the Records using Hue

Open Impala Query editor and type the describe statement in it and click on the execute button as shown in the following screenshot.

Describe Records

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

Results Tab

Advertisements
E-Books Store