Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Impala Describe statement


May 26, 2021 impala


Table of contents


The describe statement in Impala is used to provide a description of the table. The result of this statement contains information about the table, such as the column name and its data type.

Grammar

The following is the syntax of the Impala describe statement.

Describe table_name;

Cases

For example, suppose we have a table called customer in Impala that contains 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 a description of the customer table using the describe statement shown below -

[quickstart.cloudera:21000] > describe customer;

When executing the query above, Impala gets the metadata for 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

Use Hue to describe records

Open the Impala query editor and type the describe statement in it, and then click the execute button, as shown in the screenshot below.

Impala Describe statement

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

Impala Describe statement