集團(tuán)網(wǎng)站建設(shè)哪家好谷歌搜索引擎入口2022
通過(guò)DataHub提取和管理hive元數(shù)據(jù)
本文由「大千AI助手」原創(chuàng)發(fā)布,專注用真話講AI,回歸技術(shù)本質(zhì)。拒絕神話或妖魔化。搜索「大千AI助手」關(guān)注我,一起撕掉過(guò)度包裝,學(xué)習(xí)真實(shí)的AI技術(shù)!
簡(jiǎn)介
- 通過(guò)DataHub的Hive數(shù)據(jù)源連接器可以接入Hive的庫(kù)、表、列、存儲(chǔ)信息、統(tǒng)計(jì)信息等元數(shù)據(jù)
- 哪些元數(shù)據(jù)
- 庫(kù)、表的元數(shù)據(jù)
- 列的類型的元數(shù)據(jù)
- 詳細(xì)的表屬性和存儲(chǔ)的元數(shù)據(jù)
- 表、行、列的統(tǒng)計(jì)信息的元數(shù)據(jù)(需要SQL Profiling功能)
- DataHub中的功能點(diǎn)
- 資產(chǎn)容器(Asset Containers)
- 描述信息(Descriptions)
- 平臺(tái)實(shí)例(Platform Instance)
- Schema元數(shù)據(jù)(Schema Metadata)
- 分類(Classification)
- 需要設(shè)置
classification.enabled
- 需要設(shè)置
- 刪除實(shí)體檢測(cè)(Detect Deleted Entities)
- 需要設(shè)置
stateful_ingestion.remove_stale_metadata
- 需要設(shè)置
- 領(lǐng)域(Domains)
- 需要設(shè)置
domain
- 需要設(shè)置
- 底層通過(guò)Python的
pyhive
庫(kù)進(jìn)行提取
往期文章推薦:
- 20.Python3安裝MySQL-python踩坑實(shí)錄:從報(bào)錯(cuò)到完美解決的實(shí)戰(zhàn)指南
- 19.Git可視化革命:3分鐘學(xué)會(huì)用Mermaid+AI畫專業(yè)分支圖
- 18.vscode常用快捷命令和插件
- 17.AI制圖新紀(jì)元:3分鐘用Mermaid畫出專業(yè)類圖
- 16.3分鐘搞定數(shù)據(jù)可視化:Mermaid餅圖終極指南
- 15.5分鐘玩轉(zhuǎn)Swagger UI:Docker部署+靜態(tài)化實(shí)戰(zhàn)
- 14.記錄下blog的成長(zhǎng)過(guò)程
- 13.再說(shuō)一說(shuō)LangChain Runnable接口
- 12.Docker實(shí)戰(zhàn):5分鐘搞定MySQL容器化部署與最佳實(shí)踐
- 11.Ollama模板全解析:從基礎(chǔ)語(yǔ)法到高級(jí)應(yīng)用實(shí)戰(zhàn)
- 10.Ollama完全指南:從零開始玩轉(zhuǎn)本地大模型部署
- 9.django中如何解析content-type=application/json的請(qǐng)求
- 8.實(shí)測(cè)DeepSeek分詞機(jī)制:你的輸入如何變成計(jì)費(fèi)Token?
- 7.英語(yǔ)分詞進(jìn)化論:BPE相關(guān)論文匯總
- 6.硬核實(shí)戰(zhàn) | 3分鐘Docker部署ClickHouse列存數(shù)據(jù)庫(kù)
- 5.技術(shù)深解 | DeepSeek-R1-0528訓(xùn)練參數(shù)全透視:163K上下文與MoE高效架構(gòu)的基石
- 4.DeepSeek最新升級(jí)實(shí)測(cè):推理能力翻倍,但離世界頂尖還有多遠(yuǎn)?
- 3.血淚教訓(xùn)!Redis默認(rèn)配置竟會(huì)導(dǎo)致數(shù)據(jù)丟失?Docker生產(chǎn)部署指南
- 2.Function Call:大模型如何突破自身局限“使用工具“
- 1.DeepSeek動(dòng)手實(shí)踐:創(chuàng)建一個(gè)自動(dòng)連點(diǎn)器
配置
基本配置
從哪里取
sqlalchemy_uri
- string, 連接URI. 優(yōu)先級(jí)最高(高于其他連接參數(shù)).- 參考 - https://docs.sqlalchemy.org/en/14/core/engines.html#database-urls.
host_port
- string, hive地址和端口, 默認(rèn)hive:9083
, 騰訊云emr為ip:7001
username
- string, 用戶名password
- string(password), 密碼options
- map, 該配置都會(huì)作為kwargs參數(shù)傳給SQLAlchemy.create_engine
- 設(shè)置URL中的連接參數(shù),可以通過(guò)
connect_args
參數(shù)指定 - 比如設(shè)置認(rèn)證方式為L(zhǎng)DAP,
connect_args: auth: LDAP
- 設(shè)置URL中的連接參數(shù),可以通過(guò)
取什么
include_tables
- boolean, 是否提取tables的元數(shù)據(jù), 默認(rèn)True
include_views
- boolean, 是否提取views的元數(shù)據(jù). 默認(rèn)True
include_view_lineage
- boolean, 是否自動(dòng)提取view->view和table->view的血緣關(guān)系(通過(guò)DataHub的sql parser從view的創(chuàng)建語(yǔ)句中提取). 默認(rèn) Trueinclude_column_lineage
- boolean, 是否提取列級(jí)血緣關(guān)系(從storage中提取), 默認(rèn)True
include_view_column_lineage
- boolean, 是否自動(dòng)提取view->view和table->view的列級(jí)血緣關(guān)系(通過(guò)DataHub的sql parser從view的創(chuàng)建語(yǔ)句中提取), 依賴include_view_lineage
, 默認(rèn)True
emit_storage_lineage
- boolean, 是否生成storage-to-Hive的血緣, 默認(rèn)False
hive_storage_lineage_direction
- string,upstream
則storage是Hive的上游,downstream
則storage是Hive的下游, 默認(rèn)upstream
database
- string, database (catalog), 如果不設(shè)置則從所有數(shù)據(jù)庫(kù)取(可通過(guò)database_pattern
過(guò)濾)database_pattern
- AllowDenyPattern, 要提取的數(shù)據(jù)庫(kù)的正則表達(dá)式, 默認(rèn){'allow': ['.*'], 'deny': [], 'ignoreCase': True}
database_pattern.ignoreCase
- boolean, 正則匹配時(shí)是否忽略大小寫, 默認(rèn)True
database_pattern.allow
- array, 要提取的數(shù)據(jù)庫(kù)的正則表達(dá)式, 默認(rèn)['.*']
database_pattern.allow.string
- stringdatabase_pattern.deny
- array, 不提取的數(shù)據(jù)庫(kù)的正則表達(dá)式, 默認(rèn)[]
database_pattern.deny.string
- string
table_pattern
- AllowDenyPattern, 要提取的表的正則表達(dá)式, 全名匹配database.schema.table
, 默認(rèn){'allow': ['.*'], 'deny': [], 'ignoreCase': True}
- 示例
'Customer.public.customer.*'
- 實(shí)際驗(yàn)證還是
<database>.<table>
的格式 table_pattern.ignoreCase
- boolean, 正則匹配時(shí)是否忽略大小寫, 默認(rèn)True
table_pattern.allow
- array, 要提取的表的正則表達(dá)式, 默認(rèn)['.*']
table_pattern.allow.string
- stringtable_pattern.deny
- array, 不提取的表的正則表達(dá)式, 默認(rèn)[]
table_pattern.deny.string
- string
- 示例
view_pattern
- AllowDenyPattern, 要提取的視圖的正則表達(dá)式, 全名匹配database.schema.table
, 默認(rèn)取值同table_pattern
- 示例
'Customer.public.customer.*'
view_pattern.ignoreCase
- boolean, 正則匹配時(shí)是否忽略大小寫, 默認(rèn)True
view_pattern.allow
- array, 要提取的視圖的正則表達(dá)式, 默認(rèn)['.*']
view_pattern.allow.string
- stringview_pattern.deny
- array, 不提取的視圖的正則表達(dá)式, 默認(rèn)[]
view_pattern.deny.string
- string
- 示例
column_pattern
- AllowDenyPattern, 要提取的列的正則表達(dá)式, 全名匹配database.schema.table.column
, 默認(rèn){'allow': ['.*'], 'deny': [], 'ignoreCase': True}
column_pattern.ignoreCase
- boolean, 正則匹配時(shí)是否忽略大小寫, 默認(rèn)True
column_pattern.allow
- Array of string, 要提取的列的正則表達(dá)式列表, 默認(rèn)['.*']
column_pattern.allow.string
- stringcolumn_pattern.deny
- Array of string, 不要提取的列的正則表達(dá)式列表, 默認(rèn)[]
column_pattern.deny.string
- string
profile_pattern
- AllowDenyPattern, 用來(lái)提取profile的表或列的正則表達(dá)式(與table_pattern
取交集), 默認(rèn){'allow': ['.*'], 'deny': [], 'ignoreCase': True}
- 參考datahub-profile
profiling
- profile的配置, 默認(rèn){'enabled': False, 'operation_config': {'lower_freq_profile_enabled': False, 'profile_day_of_week': None, 'profile_date_of_month': None}, 'limit': None, 'offset': None, 'profile_table_level_only': False, 'include_field_null_count': True, 'include_field_distinct_count': True, 'include_field_min_value': True, 'include_field_max_value': True, 'include_field_mean_value': True, 'include_field_median_value': True, 'include_field_stddev_value': True, 'include_field_quantiles': False, 'include_field_distinct_value_frequencies': False, 'include_field_histogram': False, 'include_field_sample_values': True, 'max_workers': 20, 'report_dropped_profiles': False, 'turn_off_expensive_profiling_metrics': False, 'field_sample_values_limit': 20, 'max_number_of_fields_to_profile': None, 'profile_if_updated_since_days': None, 'profile_table_size_limit': 5, 'profile_table_row_limit': 5000000, 'profile_table_row_count_estimate_only': False, 'query_combiner_enabled': True, 'catch_exceptions': True, 'partition_profiling_enabled': True, 'partition_datetime': None, 'use_sampling': True, 'sample_size': 10000, 'profile_external_tables': False, 'tags_to_ignore_sampling': None, 'profile_nested_fields': False}
- 參考datahub-profile
特殊標(biāo)識(shí)
platform_instance
- string, 平臺(tái)實(shí)例(該配置獲取的所有資產(chǎn)所屬的平臺(tái)實(shí)例)- 參考 - https://datahubproject.io/docs/platform-instances/
storage_platform_instance
- string, storage系統(tǒng)的平臺(tái)實(shí)例env
- string, 環(huán)境名(該配置獲取的所有資產(chǎn)所屬的環(huán)境), 默認(rèn)PROD
- 比如從多個(gè)Hive實(shí)例獲取數(shù)據(jù),則可以設(shè)置
env
為不同的值
- 比如從多個(gè)Hive實(shí)例獲取數(shù)據(jù),則可以設(shè)置
domain
- map(str,AllowDenyPattern)- 參考datahub-domain
classification
- ClassificationConfig, 分類信息, 默認(rèn){'enabled': False, 'sample_size': 100, 'max_workers': 4, 'table_pattern': {'allow': ['.*'], 'deny': [], 'ignoreCase': True}, 'column_pattern': {'allow': ['.*'], 'deny': [], 'ignoreCase': True}, 'info_type_to_term': {}, 'classifiers': [{'type': 'datahub', 'config': None}]}
- 參考 - https://datahubproject.io/docs/0.15.0/metadata-ingestion/docs/dev_guides/classification/
- 參考datahub-classification
怎么取
incremental_lineage
- boolean, 是否增量更新DataHub中已有的血緣關(guān)系, 默認(rèn)False
convert_urns_to_lowercase
- boolean, 是否轉(zhuǎn)換dataset的urns為全小寫, 默認(rèn)False
use_file_backed_cache
- boolean, 是否對(duì)view定義使用基于文件的緩存, 默認(rèn) Truestateful_ingestion
- StatefulStaleMetadataRemovalConfig, 提取狀態(tài)設(shè)置stateful_ingestion.enabled
- boolean, 是否有狀態(tài)的提取,默認(rèn)如果設(shè)置pipeline_name
且指定datahub-rest
或datahub_api
則為True
, 否則False
stateful_ingestion.fail_safe_threshold
- number, 阻止?fàn)顟B(tài)改變的閾值(和之前的entity相比如果新提取的entity變化的比例超過(guò)該閾值則主動(dòng)失敗), 取值0-100, 默認(rèn)75.0
stateful_ingestion.remove_stale_metadata
- boolean, 是否軟刪除上次成功運(yùn)行提取的有但本次提取沒(méi)有的實(shí)體, 默認(rèn)True
- 依賴
stateful_ingestion.enabled=True
- 依賴
實(shí)例配置
基本配置
source:type: hiveconfig:host_port: localhost:10000database: DemoDatabaseusername: userpassword: pass# For more details on authentication, see the PyHive docs:# https://github.com/dropbox/PyHive#passing-session-configuration.# LDAP, Kerberos, etc. are supported using connect_args, which can be# added under the `options` config parameter.#options:# connect_args:# auth: KERBEROS# kerberos_service_name: hive#scheme: 'hive+http' # set this if Thrift should use the HTTP transport#scheme: 'hive+https' # set this if Thrift should use the HTTP with SSL transport#scheme: 'sparksql' # set this for Spark Thrift Server
參考
- https://datahubproject.io/docs/generated/ingestion/sources/hive/
本文由「大千AI助手」原創(chuàng)發(fā)布,專注用真話講AI,回歸技術(shù)本質(zhì)。拒絕神話或妖魔化。搜索「大千AI助手」關(guān)注我,一起撕掉過(guò)度包裝,學(xué)習(xí)真實(shí)的AI技術(shù)!