Monday 11 July 2022

HIVE: describe table_name: Get all the columns and their datatypes

Syntax

describe table_name

 

hive> describe employee;
OK
id                    int                                       
name                  string                                    
hobbies               array<string>                             
technology_experience map<string,string>                        
gender_age            struct<gender:string,age:int>                     
Time taken: 0.061 seconds, Fetched: 5 row(s)

From the output, you can confirm that there are 5 columns present in employee table, and you can see their data types too.

 

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment