Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

List tables without datatype comments in a hive schema

Highlighted

List tables without datatype comments in a hive schema

New Contributor

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 ?

 

1 REPLY 1

Re: List tables without datatype comments in a hive schema

Master Guru
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.