Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does mysql get the metadata information of hive table

2025-03-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces the relevant knowledge of "how to obtain the metadata information of hive table by mysql". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Description

1. Get it through the meta-database of hive (usually Msyql) and through the association of sql.

2. Get the table name and creation time, library name and library comments, and use S_ID as the association relationship to obtain C_ID. Field names and field comments are in the table.

Example

SELECT t2.`NAME``NAME``database_ name`,-- library name t2.`DESC``column_ comment`,-- library annotation t1.`TBL _ NAME``table_ name`,-- table name t3.`PARAM _ VALUE``column_ commet`,-- table annotation FROM_UNIXTIME (t1.`CREATE _ time`) `table_create_ time`,-- table creation time t5.`COLUMN _ name `column_ name`,-- field name t5.`COMMENT` -- Field note t5.`TYPE _ NAME`` column_data_ type`-- Field data type FROM tbls T1-- get table name and table creation time JOIN dbs T2-- get library name and library comment ON t1.DB_ID = t2.DB_ID-- use library ID as the association JOIN (SELECT TBL_ID, PARAM_KEY) PARAM_VALUE FROM table_params-get table comment WHERE PARAM_KEY = 'comment') t3ON t1.TBL_ID = t3.TBL_IDJOIN sds T4-get C_ID Used to get field comments ON t1.SD_ID = t4.SD_ID-- use S_ID as an association to obtain C_IDJOIN columns_v2 T5-- field names and field comments are all in this table, ON t4.CD_ID = t5.CD_ID. This is the end of the content of "how mysql obtains the metadata information of the hive table". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report