Impact Analysis
Impact analysis uses lineage data to understand the ripple effects of changes before you make them. By analyzing upstream dependencies and downstream consumers, you can assess risk, notify stakeholders, and plan migrations safely.
Understanding Impact Analysis
Impact analysis answers two critical questions:
| Direction | Question | Use Case |
|---|---|---|
| Upstream | What does this depend on? | Understanding data sources and transformations |
| Downstream | What will break if I change this? | Assessing change risk and affected consumers |
Impact Analysis
Click a node to see its upstream dependencies and downstream impacts.
Downstream Impact Analysis
Downstream analysis identifies all artifacts that would be affected by a change to a source asset.
API Endpoint
curl -X POST "http://localhost:8000/api/v1/lineage/impact?artifact_id=source.raw.orders.amount&max_depth=10"
Response:
{
"changed_artifact_id": "source.raw.orders.amount",
"changed_artifact_name": "raw.orders.amount",
"impacted_artifacts": [
{
"id": "model.stg_orders.amount",
"name": "stg_orders.amount",
"type": "model_column",
"certification_status": "none"
},
{
"id": "model.fct_orders.order_amount",
"name": "fct_orders.order_amount",
"type": "model_column",
"certification_status": "none"
},
{
"id": "model.fct_orders.order_total",
"name": "fct_orders.order_total",
"type": "model_column",
"certification_status": "none"
},
{
"id": "cube.orders.measure.total_revenue",
"name": "total_revenue",
"type": "measure",
"certification_status": "none"
},
{
"id": "metric.monthly_revenue",
"name": "monthly_revenue",
"type": "metric",
"certification_status": "certified"
}
],
"impacted_count": 5,
"max_depth": 10,
"warnings": [
"Certified metric 'monthly_revenue' will be affected"
],
"analysis_timestamp": "2024-01-15T10:30:00Z"
}
CLI Command
olytix-core impact source.raw.orders.amount
Output:
Impact Analysis: source.raw.orders.amount
===============================================================================
Changing this column will affect:
Models (3):
- stg_orders.amount (DIRECT dependency)
- fct_orders.order_amount (via stg_orders)
- fct_orders.order_total (via stg_orders)
Cubes (1):
- orders
Measures: total_revenue, avg_order_value
Dimensions: (none)
Metrics (4):
- monthly_revenue [CERTIFIED]
- quarterly_revenue [CERTIFIED]
- avg_order_value
- revenue_growth
Warnings:
! 2 certified metrics will be affected
! Recommended: Review with Finance team before proceeding
===============================================================================
Total Impacted: 8 artifacts
Upstream Dependency Analysis
Upstream analysis shows everything a specific asset depends on, useful for understanding data provenance.
API Endpoint
curl -X GET "http://localhost:8000/api/v1/lineage/metric.monthly_revenue/upstream?max_depth=10"
CLI Command
olytix-core lineage --upstream metric.monthly_revenue
Output:
Upstream Dependencies: monthly_revenue
===============================================================================
Sources (2):
- raw.orders.amount
- raw.orders.quantity
Models (3):
- stg_orders (columns: amount, quantity)
- fct_orders (columns: order_amount, order_total)
Cubes (1):
- orders
Measures: total_revenue
Path:
raw.orders.amount → stg_orders.amount → fct_orders.order_total
→ orders.total_revenue → monthly_revenue
===============================================================================
Common Impact Scenarios
Scenario 1: Changing a Source Column Data Type
Before changing orders.amount from INTEGER to DECIMAL:
olytix-core impact source.raw.orders.amount --include-types
Impact Analysis: raw.orders.amount (INTEGER → DECIMAL)
===============================================================================
Type-Sensitive Impacts:
Models with potential issues:
- fct_orders.order_total
Current expression: amount * quantity
Risk: Precision change may affect calculations
Measures with aggregations:
- orders.total_revenue (SUM)
Risk: Aggregation results will change precision
Downstream consumers:
- BI Tool: Executive Dashboard (3 charts)
- BI Tool: Sales Report (2 charts)
- API Consumer: mobile-app (daily sync)
Recommendation: Test with sample data before deploying
===============================================================================
Scenario 2: Renaming a Column
Before renaming customer_id to cust_id:
olytix-core impact source.raw.orders.customer_id --show-sql
Impact Analysis: raw.orders.customer_id
===============================================================================
SQL References to Update:
stg_orders.sql (line 5):
- SELECT customer_id FROM {{ source('raw', 'orders') }}
fct_orders.sql (line 12):
- JOIN {{ ref('stg_customers') }} c ON o.customer_id = c.customer_id
cubes/orders.yml (line 24):
- sql: customer_id
Total: 3 files need updates
===============================================================================
Scenario 3: Deprecating a Model
Before removing stg_legacy_orders:
olytix-core impact --deprecate model.stg_legacy_orders
Impact Analysis: Deprecating stg_legacy_orders
===============================================================================
Direct Dependents (will break):
- fct_order_history (references stg_legacy_orders)
- dim_order_status (references stg_legacy_orders)
Indirect Dependents (may be affected):
- cube.order_history
- metric.historical_revenue
Migration Steps:
1. Update fct_order_history to use stg_orders
2. Update dim_order_status to use stg_orders
3. Rebuild dependent cubes
4. Verify metrics produce same results
5. Remove stg_legacy_orders
===============================================================================
Scenario 4: Adding a New Required Column
Before adding a non-nullable column to a source:
olytix-core impact source.raw.orders --add-column "tax_amount DECIMAL NOT NULL"
Impact Analysis: Adding tax_amount to raw.orders
===============================================================================
Models using SELECT *:
- stg_orders (will inherit new column)
Models with explicit columns:
- No changes required (column must be explicitly added if needed)
Suggested Updates:
1. Add column to stg_orders if needed for downstream
2. Consider adding to fct_orders.order_total calculation
3. Update orders cube if tax should be a measure
===============================================================================
Filtering Impact Results
By Artifact Type
# Show only metric impacts
olytix-core impact source.raw.orders.amount --type metric
# Show only model and cube impacts
olytix-core impact source.raw.orders.amount --type model,cube
By Certification Status
# Show only certified artifacts
olytix-core impact source.raw.orders.amount --certified-only
# Highlight certified but show all
olytix-core impact source.raw.orders.amount --highlight-certified
By Depth
# Limit to direct dependents only
olytix-core impact source.raw.orders.amount --max-depth 1
# Deep analysis
olytix-core impact source.raw.orders.amount --max-depth 20
Programmatic Impact Analysis
Python SDK
from olytix-core import Olytix CoreClient
client = Olytix CoreClient("http://localhost:8000")
# Analyze impact
result = client.analyze_impact(
artifact_id="source.raw.orders.amount",
max_depth=10
)
# Check for certified metric impacts
certified_impacts = [
a for a in result.impacted_artifacts
if a.certification_status == "certified"
]
if certified_impacts:
print(f"WARNING: {len(certified_impacts)} certified metrics affected")
for artifact in certified_impacts:
print(f" - {artifact.name}")
# Get detailed lineage for each impact
for artifact in result.impacted_artifacts:
lineage = client.get_lineage(
artifact_id=artifact.id,
direction="upstream"
)
print(f"{artifact.name}: {len(lineage.edges)} transformation steps")
Integration with CI/CD
# .github/workflows/schema-change.yml
name: Schema Change Impact Check
on:
pull_request:
paths:
- 'sources/**'
- 'models/**'
jobs:
impact-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Detect Changed Columns
id: changes
run: |
# Extract changed column definitions
changed=$(git diff origin/main -- sources/ models/ | grep -E '^\+.*name:' | awk '{print $3}')
echo "columns=$changed" >> $GITHUB_OUTPUT
- name: Run Impact Analysis
run: |
for col in ${{ steps.changes.outputs.columns }}; do
olytix-core impact "$col" --format json > "impact_${col}.json"
done
- name: Check for Certified Metric Impacts
run: |
impacts=$(cat impact_*.json | jq '.warnings | length')
if [ "$impacts" -gt 0 ]; then
echo "::warning::Schema change affects certified metrics"
cat impact_*.json | jq '.warnings[]'
fi
- name: Post Impact Summary
uses: actions/github-script@v6
with:
script: |
const fs = require('fs');
const impacts = fs.readdirSync('.').filter(f => f.startsWith('impact_'));
let summary = '## Impact Analysis Summary\n\n';
for (const file of impacts) {
const data = JSON.parse(fs.readFileSync(file));
summary += `### ${data.changed_artifact_name}\n`;
summary += `- Impacted artifacts: ${data.impacted_count}\n`;
if (data.warnings.length > 0) {
summary += `- Warnings: ${data.warnings.join(', ')}\n`;
}
}
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: summary
});
Best Practices
1. Run Impact Analysis Before Changes
Always check downstream impacts before modifying sources or models:
# Before making any schema change
olytix-core impact <artifact> --full-report
2. Communicate with Stakeholders
Use impact results to notify affected teams:
# Generate stakeholder report
olytix-core impact source.raw.orders.amount --format report > impact_report.md
3. Plan Migrations Incrementally
For large changes, break them into steps:
# Step 1: Add new column alongside old
# Step 2: Update downstream to use new column
# Step 3: Verify all consumers migrated
olytix-core impact old_column --verify-no-consumers
# Step 4: Remove old column
4. Protect Certified Metrics
Set up alerts for changes affecting certified metrics:
# olytix-core.yml
governance:
impact_rules:
- when: certified_metric_affected
action: require_approval
approvers: [data-governance-team]
5. Document Impact Decisions
Record why changes were approved despite impacts:
olytix-core impact source.raw.orders.amount --approve \
--reason "Finance team approved precision change for Q2 reporting" \
--ticket JIRA-1234
Next Steps
- Column-Level Lineage - Understand lineage edge types and tracking
- Data Testing - Validate data after changes
- Metric Certification - Establish governance for critical metrics