datalineage-summary

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Data Lineage Summary

数据血缘总结

This skill guides the agent in investigating and summarizing the Data Lineage graph for a specific focal asset (Table-Level Lineage) or specific fields (Column-Level Lineage). It provides an intuitive left-to-right walkthrough of how data enters and leaves the asset, abstracting away complex node and link details into plain English.
本技能指导Agent调查并总结特定核心资产(表级血缘)或特定字段(列级血缘)的Data Lineage图表。它提供直观的从左到右的数据流讲解,将复杂的节点和链接细节转化为通俗易懂的文字。

Prerequisites

前提条件

This skill relies on the Google Cloud Data Lineage (Knowledge Catalog) MCP Server for graph traversal. Ensure you can run
search_lineage
queries in both upstream and downstream directions. For detailed connection configurations and tool schemas, refer to MCP Usage.
本技能依赖Google Cloud Data Lineage (Knowledge Catalog) MCP Server进行图表遍历。确保你可以在上下游两个方向运行
search_lineage
查询。有关详细的连接配置和工具架构,请参考MCP 使用说明

Workflow Logic

工作流逻辑

1. Get Lineage

1. 获取血缘数据

Fetch the lineage graph in both directions from the focal point (both upstream and downstream) by making two separate calls to the MCP tool: one with
"direction": "UPSTREAM"
and another with
"direction": "DOWNSTREAM"
.
  • Location Strategy: You MUST use the
    read_url
    tool to fetch the comprehensive list of locations dynamically from the provided Knowledge Catalog Locations link. To ensure cross-regional lineage is not missed, always verify the current list of GCP regions using this link before populating the
    locations
    array. You MUST populate the
    locations
    array with all supported physical regions fetched from this link. You may optionally additionally determine the asset's specific active region (using
    bq show
    or
    gcloud storage ls
    ).
  • Search Parameters: Use
    maxDepth = 10
    ,
    maxResults = 5000
    and
    maxProcessPerLink = 10
    as robust defaults when calling
    search_lineage
    . For example, a DOWNSTREAM call should be formatted like this (expanding the
    locations
    array as needed):
    json
    {
      "parent": "projects/project_id/locations/us",
      "locations": [
        "us",
        "us-central1",
        "us-east1",
        "us-west1",
        "europe-west1",
        "asia-northeast1"
      ],
      "rootCriteria": {
        "entities": {
          "entities": [
            {
              "fullyQualifiedName": "bigquery:project.dataset.table"
            }
          ]
        }
      },
      "direction": "DOWNSTREAM",
      "limits": {
        "maxDepth": 10,
        "maxResults": 5000,
        "maxProcessPerLink": 10
      }
    }
    Ensure you make a similar call with
    "direction": "UPSTREAM"
    to fetch the upstream lineage.
  • Column-Level Lineage (CLL): The
    search_lineage
    tool can find all Column-Level Lineage (CLL) by configuring the
    field
    array. If Table-Level Lineage (TLL) is requested, configure the call to get CLL links along with the TLL links by exploiting the
    "*"
    wildcard. For example:
    json
    "rootCriteria": {
      "entities": {
        "entities": [
          {
            "fullyQualifiedName": "bigquery:project.dataset.table",
            "field": [
              "*"
            ]
          }
        ]
      }
    }
    If evaluating a specific column, replace
    "*"
    with the specific column name (e.g.,
    "efficiency_score"
    ).
通过两次独立调用MCP工具,从核心点获取上下游两个方向的血缘图表:一次使用
"direction": "UPSTREAM"
,另一次使用
"direction": "DOWNSTREAM"
  • 位置策略:你必须使用
    read_url
    工具从提供的Knowledge Catalog 位置列表链接中动态获取完整的位置列表。为避免遗漏跨区域血缘数据,在填充
    locations
    数组前,务必通过此链接验证当前所有GCP区域。你必须将从该链接获取的所有受支持物理区域填充到
    locations
    数组中。你也可以选择(非必须)通过
    bq show
    gcloud storage ls
    确定资产的具体活跃区域。
  • 搜索参数:调用
    search_lineage
    时,使用
    maxDepth = 10
    maxResults = 5000
    maxProcessPerLink = 10
    作为可靠默认值。例如,DOWNSTREAM方向的调用格式如下(根据需要扩展
    locations
    数组):
    json
    {
      "parent": "projects/project_id/locations/us",
      "locations": [
        "us",
        "us-central1",
        "us-east1",
        "us-west1",
        "europe-west1",
        "asia-northeast1"
      ],
      "rootCriteria": {
        "entities": {
          "entities": [
            {
              "fullyQualifiedName": "bigquery:project.dataset.table"
            }
          ]
        }
      },
      "direction": "DOWNSTREAM",
      "limits": {
        "maxDepth": 10,
        "maxResults": 5000,
        "maxProcessPerLink": 10
      }
    }
    确保使用
    "direction": "UPSTREAM"
    进行类似调用,以获取上游血缘数据。
  • 列级血缘(CLL)
    search_lineage
    工具可通过配置
    field
    数组查找所有列级血缘(CLL)。如果请求的是表级血缘(TLL),可通过使用
    "*"
    通配符,配置调用以同时获取CLL链接和TLL链接。例如:
    json
    "rootCriteria": {
      "entities": {
        "entities": [
          {
            "fullyQualifiedName": "bigquery:project.dataset.table",
            "field": [
              "*"
            ]
          }
        ]
      }
    }
    如果分析特定列,将
    "*"
    替换为具体列名(例如
    "efficiency_score"
    )。

2. Summarize

2. 生成总结

Generate the summary using the prompt guidelines below.
  • Persona: Act as an expert Data Lineage Analyst generating a concise, easy-to-understand left-to-right walkthrough of the data flow.
  • Structure & Flow: Start immediately with the summary text, structured as follows:
    • Overall Flow Type: State the inferred workflow type and data domain (e.g., "This appears to be a Feature Engineering workflow...").
    • Systems Overview: List the primary systems involved up front. If the request is for Column-Level Lineage, you MUST explicitly declare that the scope of the analysis is limited to the specified field up front.
    • Upstream Lineage: Use the exact bold header
      **Upstream Lineage:**
      . Narrative must detail how data arrives at the focal asset, mentioning key source systems, projects, and processing tasks (e.g., Spark on Dataproc).
    • Downstream Lineage: Use the exact bold header
      **Downstream Lineage:**
      . Detail where data goes from the focal asset to final consumer systems.
    • Analysis Metadata: Display the parameters used for the API call to provide transparency on the boundaries of the summary. The output must contain:
      • Locations Searched:
        {list_of_locations_queried}
      • Parent Location:
        {parent_path}
      • Depth Limit:
        {maxDepth}
      • Process per Link Limit:
        {maxProcessPerLink}
      • Tip for User: A prompt suggesting they can ask to rerun with expanded locations (if not all were used) or depth.
  • Granularity Constraints:
    • Prioritize flows between Systems, Projects, and Datasets over individual files/tables.
    • You MUST explicitly list specific asset names (e.g., source tables, intermediate views, consumer tables) if there are fewer than 5. Do not just summarize counts if there are fewer than 5; name them explicitly. Otherwise, if 5 or more, aggregate them by count (e.g., "5 GCS buckets").
    • Only mention counts for ultimate sources, final consumers, and total assets.
    • Do not repeat project names redundantly for every dataset if only one project is involved.
  • Tone: Avoid jargon and generic phrases like "There are distinct factual points." Be direct and clear. The final output is Markdown.
按照以下提示指南生成总结。
  • 角色定位:作为专业的数据血缘分析师,生成简洁、易懂的从左到右数据流讲解。
  • 结构与流程:直接从总结文本开始,结构如下:
    • 整体流类型:说明推断的工作流类型和数据领域(例如:“这似乎是一个特征工程工作流……”)。
    • 系统概述:先列出涉及的主要系统。如果请求的是列级血缘,必须在开头明确说明分析范围仅限于指定字段。
    • 上游血缘:使用加粗标题
      **上游血缘:**
      。叙述需详细说明数据如何到达核心资产,提及关键源系统、项目和处理任务(例如Dataproc上的Spark)。
    • 下游血缘:使用加粗标题
      **下游血缘:**
      。详细说明数据从核心资产流向最终消费系统的路径。
    • 分析元数据:显示API调用使用的参数,以明确总结的边界。输出必须包含:
      • 搜索的位置
        {查询的位置列表}
      • 父位置
        {父路径}
      • 深度限制
        {maxDepth}
      • 每个链接的进程限制
        {maxProcessPerLink}
      • 用户提示:建议用户如果未使用所有位置或需要更大深度,可以要求重新运行查询。
  • 粒度约束
    • 优先关注系统、项目和数据集之间的流,而非单个文件/表。
    • 如果资产数量少于5个,必须明确列出具体的资产名称(例如源表、中间视图、消费表)。如果数量少于5个,不要只总结数量,要明确命名。否则,如果数量为5个或更多,按数量汇总(例如“5个GCS存储桶”)。
    • 仅提及最终源、最终消费者和总资产的数量。
    • 如果仅涉及一个项目,不要为每个数据集重复提及项目名称。
  • 语气:避免行话和诸如“存在不同的事实点”之类的通用表述。直接清晰。最终输出为Markdown格式。

3. Return the Summary

3. 返回总结

Return the final summarized output back to the user.
将最终的总结输出返回给用户。

External Documentation

外部文档