byted-bytehouse-data-asset-analyzer
ByteHouse 数据资产和血缘分析 Skill
🔵 ByteHouse 品牌标识
「ByteHouse」—— 火山引擎云原生数据仓库,极速、稳定、安全、易用
本Skill基于ByteHouse MCP Server,提供完整的数据资产盘点和血缘分析能力
描述
基于ByteHouse MCP Server,生成数据资产目录和血缘分析的技能。
当以下情况时使用此 Skill: (1) 需要获取数据库表结构和字段信息 (2) 需要生成数据资产目录 (3) 需要分析表之间的血缘关系 (4) 用户提到"数据资产"、"血缘分析"、"表结构"、"字段分析"
前置条件
- Python 3.8+
- uv (已安装在
/root/.local/bin/uv) - ByteHouse MCP Server Skill - 本skill依赖
bytehouse-mcpskill提供的ByteHouse访问能力
依赖关系
本skill依赖 bytehouse-mcp skill,使用其提供的MCP Server访问ByteHouse。
确保 bytehouse-mcp skill已正确配置并可以正常使用。
📁 文件说明
- SKILL.md - 本文件,技能主文档
- data_asset_analyzer.py - 数据资产和血缘分析主程序
- README.md - 快速入门指南
配置信息
ByteHouse连接配置
本skill复用 bytehouse-mcp skill的配置。请确保已在 bytehouse-mcp skill中配置好:
export BYTEHOUSE_HOST="<ByteHouse-host>"
export BYTEHOUSE_PORT="<ByteHouse-port>"
export BYTEHOUSE_USER="<ByteHouse-user>"
export BYTEHOUSE_PASSWORD="<ByteHouse-password>"
export BYTEHOUSE_SECURE="true"
export BYTEHOUSE_VERIFY="true"
🎯 功能特性
1. 完整Schema获取
- 获取指定数据库的所有表
- 获取每张表的所有字段
- 提取表引擎、注释等元数据
- 解析CREATE TABLE语句
2. 数据资产目录生成
- 表统计(总表数、总列数)
- 引擎分布统计
- 自动标签生成
- 表资产详情
3. 血缘分析
- 表关系识别(Distributed → Local)
- 列相似性分析
- 关系可视化
🚀 快速开始
方法1: 运行数据资产和血缘分析
cd /root/.openclaw/workspace/skills/data-asset-analyzer
# 先设置环境变量(复用bytehouse-mcp的配置)
export BYTEHOUSE_HOST="<ByteHouse-host>"
export BYTEHOUSE_PORT="<ByteHouse-port>"
export BYTEHOUSE_USER="<ByteHouse-user>"
export BYTEHOUSE_PASSWORD="<ByteHouse-password>"
export BYTEHOUSE_SECURE="true"
export BYTEHOUSE_VERIFY="true"
# 运行分析工具
uv run data_asset_analyzer.py
分析内容包括:
- 数据库完整schema(所有表和字段)
- 数据资产目录(表统计、引擎分布、自动标签)
- 血缘分析(表关系、列相似性)
输出文件(保存在 output/ 目录):
schema_{database}_{timestamp}.json- 完整的数据库schemacatalog_{database}_{timestamp}.json- 数据资产目录lineage_{database}_{timestamp}.json- 血缘分析报告
💻 程序化使用
使用分析器模块
#!/usr/bin/env python3
# /// script
# dependencies = [
# "mcp>=1.0.0",
# ]
# ///
import asyncio
import sys
import os
# 添加bytehouse-mcp skill的路径
BYTEHOUSE_MCP_PATH = os.path.join(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
"bytehouse-mcp"
)
sys.path.insert(0, BYTEHOUSE_MCP_PATH)
from data_asset_analyzer import DataAssetAnalyzer
async def main():
analyzer = DataAssetAnalyzer()
await analyzer.connect()
# 分析数据库
result = await analyzer.analyze_database("default")
# result 包含:
# - schema: 完整的数据库schema
# - catalog: 数据资产目录
# - lineage: 血缘分析
# - files: 生成的文件路径
asyncio.run(main())
📊 输出文件说明
1. Schema文件 (schema_*.json)
包含数据库的完整结构:
{
"database": "default",
"analyzed_at": "2026-03-12T19:50:00",
"tables": [
{
"name": "conversation_feedback",
"comment": "",
"engine": "Distributed",
"columns": [
{
"name": "session_id",
"type": "String",
"comment": ""
}
],
"create_table_query": "CREATE TABLE ..."
}
]
}
2. 数据资产目录 (catalog_*.json)
包含数据资产的统计信息:
{
"database": "default",
"generated_at": "2026-03-12T19:50:00",
"summary": {
"total_tables": 8,
"total_columns": 45,
"engines": {
"Distributed": 4,
"HaMergeTree": 3,
"MergeTree": 1
}
},
"tables": [
{
"name": "conversation_feedback",
"comment": "",
"engine": "Distributed",
"column_count": 10,
"columns": [...],
"tags": ["distributed", "user-feedback"]
}
]
}
3. 血缘分析 (lineage_*.json)
包含表关系和列相似性:
{
"database": "default",
"generated_at": "2026-03-12T19:50:00",
"table_relationships": [
{
"source_table": "conversation_feedback",
"relationships": [
{
"type": "distributed_to_local",
"target_table": "conversation_feedback_local",
"description": "Distributed表指向Local表"
}
]
}
],
"column_similarities": [
{
"column_name": "session_id",
"column_type": "String",
"found_in_tables": [
"conversation_feedback",
"conversation_feedback_local"
]
}
]
}
🏷️ 自动标签生成
分析器会根据表名和引擎自动生成标签:
| 标签 | 说明 |
|---|---|
merge-tree |
使用MergeTree引擎 |
distributed |
使用Distributed引擎 |
high-availability |
使用HaMergeTree或HaUniqueMergeTree |
log-table |
表名包含"log" |
user-feedback |
表名包含"feedback" |
local-table |
表名以"_local"结尾 |
test-table |
表名包含"test" |
📚 更多信息
详细使用说明请参考 bytehouse-mcp skill
最后更新: 2026-03-12
More from bytedance/agentkit-samples
byted-web-search
火山引擎联网搜索 API,返回网页/图片结果。联网搜索场景优先使用本 skill。触发词包括:查/搜/找、真的吗/靠谱吗/确认/核实、最近/今天/最新/近期、出处/来源/链接、有什么/有哪些/推荐、价格/政策/汇率/行情、对比/区别/哪个好、听说/据说/不太确定、热搜/热门/火、帮我看/了解一下、求证/辟谣、值不值得/该不该。任务依赖在线事实或时效性时优先使用。若回答可能依赖外部事实,优先调用本 skill 再作答。支持 API Key / AK/SK。
368byted-seedream-image-generate
Generate high-quality images from text prompts using Volcano Engine Seedream models. Supports multiple artistic styles and aspect ratios. Use this skill when users want to create images from text descriptions, generate artwork in various styles, create visual content for creative projects, or need AI-powered image generation capabilities.
182byted-las-video-edit
Extracts and clips video segments from long videos using natural language descriptions. AI-powered smart video editing, video trimming, and video cutting powered by Volcengine LAS. Describe what you want — scenes, people, objects, actions, events — and get trimmed clips automatically. Video search and video content retrieval: find and locate specific people, objects, or scenes in footage. Supports reference images for person matching and object matching (search video by image). Two modes: simple (fast) and detail (thorough, optional ASR). Use this skill when the user wants to edit/clip/cut videos using natural language descriptions, extract highlights or key moments from videos, find specific people/objects/scenes in video footage (by text or reference image), compile highlight reels from long videos, trim video segments, or do AI-powered smart video editing.
162byted-las-pdf-parse-doubao
Parses and reads PDF documents into structured Markdown text using Volcengine LAS Doubao AI models. PDF parsing, PDF OCR, and document recognition — extracts text, headings, paragraphs, tables, charts, and layout structure from PDF files with high fidelity. Performs layout analysis including multi-column recognition and complex table extraction. Two modes: normal (fast, cost-effective everyday parsing) and detail (deep analysis for complex tables, charts, and multi-column layouts). Converts PDF to Markdown, PDF to text, and structured data. Digitizes scanned PDF documents and scanned images via OCR. Supports TOS paths, HTTP URLs, and local file upload. Async submit-poll workflow with batch processing support. Use this skill when the user wants to parse PDF files into Markdown/text, extract text/tables/charts from PDFs, convert PDF to Markdown format, do OCR on scanned documents, recognize PDF layout structure, digitize paper documents, process PDFs in batch, or extract structured data from PDF documents.
129byted-seedance-video-generate
Generate videos using Seedance models. Invoke when user wants to create videos from text prompts, images, or reference materials.
108byted-data-search
|
106