1
---
2
name: datalineage-bigquery-asset-impact-analysis
3
metadata:
4
version: "1.0.2"
5
category: BigDataAndAnalytics
6
description: >-
7
Analyzes the downstream impact (blast radius) using data lineage on Google Cloud when a BigQuery table or view is broken, stale, or modified.
8
Identifies all downstream tables, dashboards, and processes that will be affected.
9
Use when:
10
- Performing a blast radius or impact analysis for a BigQuery table or view.
11
- Assessing the consequences of modifying, deleting, or pausing updates to a BigQuery asset.
12
- Identifying downstream dependencies (tables, dashboards, processes) of a BigQuery asset.
13
Don't use for:
14
- General BigQuery querying or data analysis (use BigQuery-related tools instead).
15
- Non-BigQuery assets (e.g., Cloud Storage files) unless they are part of the BigQuery lineage.
16
- Creating or modifying lineage links directly.
17
---
18
19
# BigQuery Asset Impact Analysis
20
21
This skill guides the agent in performing a downstream impact analysis (blast
22
radius assessment) when a BigQuery table or view is reported as broken, stale,
23
missing, or when a user is planning maintenance and wants to know the
24
consequences of modifying or pausing updates to an asset.
25
26
It relies primarily on the **data lineage (Knowledge Catalog) MCP Server** on
27
Google Cloud to discover relationships between assets.
28
29
## Attribution
30
31
**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
32
MUST read [Usage Attribution](references/attribution.md). For commands executed
33
directly in the terminal (never in generated scripts, Terraform, or user code),
34
prefix `gcloud` with
35
`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:datalineage-bigquery-asset-impact-analysis)"`
36
and append `agent-skills/1.0 (skill:datalineage-bigquery-asset-impact-analysis)` to `User-Agent` headers.
37
38
## Prerequisites
39
40
This skill requires access to the data lineage API on Google Cloud and an active
41
client connection to the Data Lineage MCP Server. For detailed connection
42
configurations and tool schemas, refer to [MCP Usage](references/mcp-usage.md).
43
44
## Analysis Workflow
45
46
### 1. Resolve the Asset's Fully Qualified Name (FQN)
47
48
* Ensure you have the correct FQN format for the BigQuery asset:
49
* *Format:* `bigquery:{project_id}.{dataset_id}.{table_or_view_id}`
50
* *Example:* `bigquery:my-prod-project.analytics.orders`
51
52
53
### 2. Determine Locations and Parent Path
54
55
Identify the locations to search and construct the Data Lineage API request:
56
57
* **Discover Asset Location**: Run the command `bq show --format=json
58
{project_id}:{dataset_id}` and extract the `location` field (e.g.,
59
`us-central1` or `us`). If location discovery fails due to permissions or
60
missing tools, prompt the user for the dataset's location.
61
* **Set Parent Path**: Set the `parent` path using the project ID and the
62
MCP server's location. Consult the `DataLineageServer` tool definition
63
to find the configured region or location (e.g., `us`). The format is:
64
`projects/{project_id}/locations/{mcp_server_location}`.
65
* **Configure Search Scope**: Include the discovered asset location in the
66
`locations` array of the payload (e.g., `["us-central1"]` or `["us",
67
"us-central1"]`).
68
69
### 3. Retrieve the Downstream Lineage Graph
70
71
Call the `DataLineageServer:search_lineage` tool to fetch downstream
72
relationships.
73
74
* **Direction**: Set to `DOWNSTREAM`.
75
* **Search Parameters**: Use `max_depth = 10` and `max_process_per_link = 5`
76
as robust defaults.
77
78
### 4. Identify the Blast Radius
79
80
Traverse the returned lineage links to build the impact graph:
81
82
* **Affected Assets**: The `target` of each link represents a downstream asset
83
that depends on your source asset.
84
* **Transform Processes**: Inspect the `processes` field on each link. This
85
identifies the ETL pipelines, BigQuery Views, or Scheduled Queries that
86
propagate the data.
87
* **Direct vs. Indirect Impact**:
88
* **Direct Impact (Depth 1)**: Assets directly consuming the source asset.
89
If a link has `dependency_type: EXACT_COPY`, mark the target as
90
"Directly Stale / Identical Copy".
91
* **Indirect Impact (Depth > 1)**: Assets further down the stream that
92
will experience cascading stale data or failures.
93
94
### 5. Summarize and Format the Output
95
96
Present your findings clearly to the user using the following structure:
97
98
1. **Executive Summary**: State the total number of downstream assets affected
99
and the maximum depth of the impact.
100
2. **Critical Path**: Highlight high-priority downstream assets (e.g., assets
101
containing "prod", "dashboard", "reporting", or "master" in their names).
102
3. **Blast Radius Table**: A clean Markdown table listing the dependencies. You
103
MUST include all columns:
104
105
| Downstream Asset | Transform Process | Depth | Impact Type |
106
| :------------------------------- | :------------------------------------ | :---- | :---------- |
107
| `bigquery:project.dataset.table` | `projects/p/locations/l/processes/proc` | 1 | Direct |
108
| `bigquery:project.dataset.view` | `projects/p/locations/l/processes/view` | 2 | Indirect |
109
4. **Analysis Metadata**: Provide transparency on the parameters and boundaries
110
of your search so the user can choose to expand them:
111
* **Locations Searched**: `{list_of_locations_queried}`
112
* **Parent Location**: `{parent_path}`
113
* **Depth Limit**: `{max_depth}`
114
* **Process per Link Limit**: `{max_process_per_link}`
115
* *Tip for User*: Let the user know they can request to rerun the analysis
116
with expanded locations or larger depth limits.
117
118
## Crucial Constraints & Guardrails
119
120
1. **Interpret Empty Responses Correctly**:
121
* If the lineage response is empty, immediately assume that no
122
dependencies exist in the queried locations and report this to the
123
user.
124
2. **Strictly Banned Bypasses**:
125
* Exclusively retrieve downstream relationships using the
126
`DataLineageServer:search_lineage` tool.
127
3. **Verify Asset Existence First**:
128
* If `bq show` indicates the source table does not exist, stop and report
129
this directly to the user. Do not attempt to guess alternative table
130
names unless the user explicitly instructs you to do so.
131
4. **No Output Shortcutting or Hallucinated Artifacts**:
132
* Present the complete downstream blast radius table directly in your
133
final response. Avoid telling the user you have created a separate
134
Markdown file or artifact containing the details unless you have
135
explicitly executed file-writing tools to create it.
136
137
## Reference Directory
138
139
- [MCP Usage](references/mcp-usage.md): Using the data lineage remote MCP
140
server on Google Cloud and tool preferences.
141
142
## External Documentation
143
144
- [Knowledge Catalog Data Lineage Documentation](https://cloud.google.com/dataplex/docs/about-data-lineage)
145
- [Use the Data Lineage MCP server](https://docs.cloud.google.com/dataplex/docs/use-lineage-mcp)
146
- [Knowledge Catalog Data Lineage API Reference](https://cloud.google.com/dataplex/docs/reference/data-lineage/rest)
147