Reply
Highlighted
New Contributor
Posts: 2
Registered: ‎06-03-2015

List tables without datatype comments in a hive schema

Hi,

 

We have a requirement where we need to identify the tables which are not having comments added along with the data type while creating the tables.

 

Eg -

  `emp_id` double COMMENT 'decimal(11,0)'

 

We have around 15k tables.

 

I am planning to do it in shell script with iterating through the list of tables -> describe them -> grep for COMMENT

 

 

 

Is there any other better way to do this task ?

 

Posts: 1,886
Kudos: 425
Solutions: 300
Registered: ‎07-31-2013

Re: List tables without datatype comments in a hive schema

Your described way would be the most straight-forward implementation. You could also write HCatalog API programs to fetch metadata and inspect objects (if you favour a programming language over a shell script).

Finally, you could also, if you are well versed with the Hive DB schematics, use regular SQL to query the DB directly, but this would not be portable as the DB schematics are not public interfaces and can change at any release in future.