---
id: gh-datalineage-bigquery-asset-impact-analysis
name: "datalineage-bigquery-asset-impact-analysis"
url: https://skills.yangsir.net/skill/gh-datalineage-bigquery-asset-impact-analysis
author: google
domain: cloud-infra
tags: ["bigquery", "data-lineage", "impact-analysis", "data-governance", "google-cloud"]
install_count: 6200
rating: 4.40 (120 reviews)
github: https://github.com/google/skills/tree/main/skills/cloud/datalineage-bigquery-asset-impact-analysis
---

# datalineage-bigquery-asset-impact-analysis

> 此技能用于对 BigQuery 表或视图进行下游影响分析（blast radius 评估），自动发现依赖该资产的 ETL 管道、视图和查询，帮助用户在变更或维护前评估风险范围，避免意外中断。

**Stats**: 6,200 installs · 4.4/5 (120 reviews)

## Before / After 对比

### BigQuery 资产变更影响分析效率

**Before**:

没有此技能时，用户需要手动在 BigQuery 系统表中查询依赖关系，或逐表检查下游作业，通常耗时 2 小时以上且容易遗漏关键依赖。

**After**:

此技能自动调用 Data Lineage API 检索完整依赖图，10 分钟内生成结构化的影响分析报告，精准识别直接与间接影响。

| Metric | Before | After | Change |
|---|---|---|---|
| 分析耗时 | 120分钟 | 10分钟 | -92% |
| 遗漏关键依赖次数 | 30% | 5% | -83% |

## Readme

# BigQuery Asset Impact Analysis

This skill guides the agent in performing a downstream impact analysis (blast
radius assessment) when a BigQuery table or view is reported as broken, stale,
missing, or when a user is planning maintenance and wants to know the
consequences of modifying or pausing updates to an asset.

It relies primarily on the **Google Cloud Data Lineage (Knowledge Catalog) MCP Server**
to discover relationships between assets.

## Prerequisites

This skill requires access to the Google Cloud Data Lineage API and an active
client connection to the Data Lineage MCP Server. For detailed connection
configurations and tool schemas, refer to [MCP Usage](references/mcp-usage.md).

## Analysis Workflow

### 1. Resolve the Asset's Fully Qualified Name (FQN)

*   Ensure you have the correct FQN format for the BigQuery asset:
    *   *Format:* `bigquery:{project_id}.{dataset_id}.{table_or_view_id}`
    *   *Example:* `bigquery:my-prod-project.analytics.orders`


### 2. Determine Locations and Parent Path

Identify the locations to search and construct the Data Lineage API request:

*   **Discover Asset Location**: Run the command `bq show --format=json
    {project_id}:{dataset_id}` and extract the `location` field (e.g.,
    `us-central1` or `us`). If location discovery fails due to permissions or
    missing tools, prompt the user for the dataset's location.
*   **Set Parent Path**: Set the `parent` path using the project ID and the
    MCP server's location. Consult the `DataLineageServer` tool definition
    to find the configured region or location (e.g., `us`). The format is:
    `projects/{project_id}/locations/{mcp_server_location}`.
*   **Configure Search Scope**: Include the discovered asset location in the
    `locations` array of the payload (e.g., `["us-central1"]` or `["us",
    "us-central1"]`).

### 3. Retrieve the Downstream Lineage Graph

Call the `DataLineageServer:search_lineage` tool to fetch downstream
relationships.

*   **Direction**: Set to `DOWNSTREAM`.
*   **Search Parameters**: Use `max_depth = 10` and `max_process_per_link = 5`
    as robust defaults.

### 4. Identify the Blast Radius

Traverse the returned lineage links to build the impact graph:

*   **Affected Assets**: The `target` of each link represents a downstream asset
    that depends on your source asset.
*   **Transform Processes**: Inspect the `processes` field on each link. This
    identifies the ETL pipelines, BigQuery Views, or Scheduled Queries that
    propagate the data.
*   **Direct vs. Indirect Impact**:
    *   **Direct Impact (Depth 1)**: Assets directly consuming the source asset.
        If a link has `dependency_type: EXACT_COPY`, mark the target as
        "Directly Stale / Identical Copy".
    *   **Indirect Impact (Depth > 1)**: Assets further down the stream that
        will experience cascading stale data or failures.

### 5. Summarize and Format the Output

Present your findings clearly to the user using the following structure:

1.  **Executive Summary**: State the total number of downstream assets affected
    and the maximum depth of the impact.
2.  **Critical Path**: Highlight high-priority downstream assets (e.g., assets
    containing "prod", "dashboard", "reporting", or "master" in their names).
3.  **Blast Radius Table**: A clean Markdown table listing the dependencies. You
    MUST include all columns:

    | Downstream Asset                 | Transform Process                     | Depth | Impact Type |
    | :------------------------------- | :------------------------------------ | :---- | :---------- |
    | `bigquery:project.dataset.table` | `projects/p/locations/l/processes/proc` | 1     | Direct      |
    | `bigquery:project.dataset.view`  | `projects/p/locations/l/processes/view` | 2     | Indirect    |
4.  **Analysis Metadata**: Provide transparency on the parameters and boundaries
    of your search so the user can choose to expand them:
    *   **Locations Searched**: `{list_of_locations_queried}`
    *   **Parent Location**: `{parent_path}`
    *   **Depth Limit**: `{max_depth}`
    *   **Process per Link Limit**: `{max_process_per_link}`
    *   *Tip for User*: Let the user know they can request to rerun the analysis
        with expanded locations or larger depth limits.

## Crucial Constraints & Guardrails

1.  **Interpret Empty Responses Correctly**:
    *   If the lineage response is empty, immediately assume that no
        dependencies exist in the queried locations and report this to the
        user.
2.  **Strictly Banned Bypasses**:
    *   Exclusively retrieve downstream relationships using the
        `DataLineageServer:search_lineage` tool.
3.  **Verify Asset Existence First**:
    *   If `bq show` indicates the source table does not exist, stop and report
        this directly to the user. Do not attempt to guess alternative table
        names unless the user explicitly instructs you to do so.
4.  **No Output Shortcutting or Hallucinated Artifacts**:
    *   Present the complete downstream blast radius table directly in your
        final response. Avoid telling the user you have created a separate
        Markdown file or artifact containing the details unless you have
        explicitly executed file-writing tools to create it.

## Reference Directory

-   [MCP Usage](references/mcp-usage.md): Using the Google Cloud Data Lineage
    remote MCP server and tool preferences.

## External Documentation

-   [Google Cloud Knowledge Catalog Data Lineage Documentation](https://cloud.google.com/dataplex/docs/about-data-lineage)
-   [Use the Data Lineage MCP server](https://docs.cloud.google.com/dataplex/docs/use-lineage-mcp)
-   [Knowledge Catalog Data Lineage API Reference](https://cloud.google.com/dataplex/docs/reference/data-lineage/rest)


---
*Source: https://skills.yangsir.net/skill/gh-datalineage-bigquery-asset-impact-analysis*
*Markdown mirror: https://skills.yangsir.net/api/skill/gh-datalineage-bigquery-asset-impact-analysis/markdown*