Reply
Highlighted
Explorer
Posts: 14
Registered: ‎12-10-2018

Get all DDL-info from hive metastore

Hi, i need to collect information like "create table" statment: table and schema names, columns and its types, comments and so on.

 

So, i'm able to collect table schema and table names and its location ("TBLS"), columns ("COLUMNS_V2") and table prooperties ("TABLE_PARAMS").

But i can't get any info about PK and partitions. Tables "PARTITIONS", "PARTITION_KEYS", "IDXS", "INDEX_PARAMS" are empty. So, i don't know where can i find information about. Where's it?

Of course, i create table with partitions and primary keys.

 

Oh, and i should be get type of table too: parquete, textfile or kudu-table. Havn't this info too.

Explorer
Posts: 14
Registered: ‎12-10-2018

Re: Get all DDL-info from hive metastore

more, i can't get DEFAULT value of column.
Cloudera Employee
Posts: 503
Registered: ‎03-23-2015

Re: Get all DDL-info from hive metastore

Have you added partitions to those tables? If not, then PARTITIONS table will certainly be empty. Try to add partitions first and then check those tables.

Same for Indexes.

I haven't be able to find where the primary key being stored, still checking.

Do not think Hive supports default values.

Explorer
Posts: 14
Registered: ‎12-10-2018

Re: Get all DDL-info from hive metastore

Metainfo "partitions" mast have information about rules for partition (what column, size of part), not "partition instances".
The same about index - need info about tuple of columns included into index.
Announcements