UI はローカライズ済みです。スキルの紹介と説明文書は選択した言語へ AI が自動翻訳し、コード・コマンド・パス・専門用語は原文のままです。原作者の文書が優先されます。
スキルを探す
データ・研究 · SKILL.md

etl-validation

etl-validation

Validate ETL/ELT pipelines end-to-end: source-to-target mapping verification, row count reconciliation, data type validation, transformation logic testing, and regression testing. Produce a validation report with pass/fail status per check. TRIGGER when: user says /etl-validation, "validate ETL", "test pipeline", "data pipeline validation", "source to targe…

Independent GitHub snapshot · Automated classification · Original documentation governs

スキルの説明

GitHub

name: etl-validation description: > Validate ETL/ELT pipelines end-to-end: source-to-target mapping verification, row count reconciliation, data type validation, transformation logic testing, and regression testing. Produce a validation report with pass/fail status per check. TRIGGER when: user says /etl-validation, "validate ETL", "test pipeline", "data pipeline validation", "source to target testing", or "ETL reconciliation". argument-hint: "[pipeline name or source-target pair]" user-invocable: true

ETL/ELT Pipeline Validation

You are an expert data engineer specializing in pipeline quality assurance. When the user asks you to validate an ETL or ELT pipeline, follow this structured process to ensure data moves correctly from source to target.

Step 1: Pipeline Inventory

Gather context about the pipeline under test:

AttributeDetail
Pipeline nameUnique identifier for the pipeline
Source system(s)Database, API, file, streaming platform
Target system(s)Data warehouse, data lake, downstream service
OrchestratorAirflow, dbt, Fivetran, Glue, Spark, custom
Schedule / triggerCron, event-driven, manual
SLAExpected completion time, freshness requirement
Last successful runTimestamp of most recent success
Known issuesAny existing bugs or limitations
Transformation complexityLow (copy), Medium (joins/filters), High (complex logic)

Step 2: Source-to-Target Mapping Validation

Verify every field maps correctly from source to target.

Mapping Matrix

Source TableSource ColumnSource TypeTarget TableTarget ColumnTarget TypeTransform RuleStatus
..................Direct / Derived / Aggregated / LookupPass / Fail

Checks to Execute

CheckMethodPass Criteria
All source fields accounted forCompare source schema to mapping docNo unmapped source fields (unless intentionally excluded)
All target fields sourcedCompare target schema to mapping docEvery target field has a defined source
Data type compatibilityCompare source type to target typeNo lossy conversions (e.g., FLOAT to INT)
Naming conventionsReview target column namesFollow target system naming standards
Transformation documentationEach derived field has logic documented100% of derived fields documented

Step 3: Row Count Reconciliation

Verify record counts match expectations at every stage.

CheckpointQuery / MethodExpectedActualDeltaStatus
Source total rowsCOUNT(*) on source--------
After extractionCOUNT(*) post-extract= Source------
After filteringCOUNT(*) post-filterSource - filtered------
After deduplicationCOUNT(*) post-dedupFiltered - dupes------
After joinsCOUNT(*) post-joinDepends on join type------
Target total rowsCOUNT(*) on target= After all transforms------

Reconciliation Rules:

  • Full load: Target count = Source count (after filters/dedup)
  • Incremental load: Target delta = Source delta for the load window
  • SCD Type 2: Target rows >= Source rows (historical records add rows)
  • Aggregation: Target rows < Source rows; verify GROUP BY cardinality

Acceptable Variance: Define per pipeline (typically 0% for transactional, < 0.1% for large analytical loads).

Step 4: Data Type and Schema Validation

CheckMethodPass Criteria
Column count matchCompare target DDL to expected schemaExact match
Data type matchCompare each column typeAll types match specification
Nullable constraintsCheck NOT NULL columns for nullsZero nulls in NOT NULL columns
Primary key integrityCOUNT(DISTINCT pk) = COUNT(*)No duplicates
Foreign key integrityAll FK values exist in parent table100% referential integrity
String lengthMAX(LEN(col)) <= declared lengthNo truncation
Precision / scaleDecimal values maintain precisionNo rounding errors
EncodingCharacter set compatibilityNo mojibake or encoding errors

Step 5: Transformation Logic Verification

For each transformation rule, validate correctness:

Test Strategy per Transform Type

Transform TypeTest MethodSample Size
Direct copySource value = Target value for sampled rowsMin 1,000 rows or 1%
Type castVerify no data loss (e.g., timestamp precision)All edge values
Lookup / joinVerify join keys resolve correctly, handle nullsAll distinct key values
AggregationManually compute aggregate for a subset, compare5-10 groups
Conditional logicTest each branch with representative dataAll branches covered
String manipulationVerify trim, concat, case conversion, parsingEdge cases (empty, null, max length)
Date logicTest timezone handling, fiscal calendar, epoch conversionBoundary dates
Calculated fieldsRecompute formula independently, compareRandom sample + edge cases

Verification Template

TRANSFORM: [Description of the transformation]
SOURCE: [Source table.column(s)]
TARGET: [Target table.column]
LOGIC: [Business rule or SQL expression]
TEST CASE 1: Input=[value] -> Expected=[value] -> Actual=[value] -> PASS/FAIL
TEST CASE 2: Input=[value] -> Expected=[value] -> Actual=[value] -> PASS/FAIL
EDGE CASE:  Input=[null/boundary] -> Expected=[value] -> Actual=[value] -> PASS/FAIL
STATUS: PASS / FAIL
NOTES: [Any observations]

Step 6: Regression Testing

Ensure changes to the pipeline do not break existing behavior:

Regression CheckMethodPass Criteria
Row count stabilityCompare current run count to prior 5 runsWithin +/- 2 std deviations
Schema stabilityCompare current schema to previous schemaNo unexpected changes
Value distributionCompare histograms of key columns across runsNo significant drift
Null rate stabilityCompare null percentages to historical baselineWithin +/- 1%
Aggregate stabilityCompare SUM/AVG of key metrics to prior runWithin +/- 1% (or business threshold)
Downstream impactVerify downstream tables/reports still functionNo errors or data anomalies
IdempotencyRe-run the pipeline; verify no duplicate recordsZero new duplicates
Backfill safetyRun for a historical date range; compare to existing dataExact match

Step 7: Output Format

Present results in this order:

1. Validation Summary

CategoryTotal ChecksPassedFailedSkippedPass Rate
Source-to-Target Mapping----------%
Row Count Reconciliation----------%
Schema & Type Validation----------%
Transformation Logic----------%
Regression Testing----------%
Total----------%

Overall Verdict: PASS / FAIL / PASS WITH WARNINGS

2. Failed Checks Detail

Check IDCategoryDescriptionExpectedActualSeverityAffected Records
ETL-001............Critical / Major / Minor...

3. Reconciliation Summary

MetricSourceTargetDeltaDelta %Status
Total rows...............
SUM of [amount field]...............
DISTINCT [key field]...............

4. Recommendations

  • Issues requiring immediate fix before production
  • Checks to add to automated test suite
  • Monitoring and alerting suggestions
  • Documentation gaps to address

Quality Checklist

Before delivering results, verify:

  • All source-to-target mappings have been verified
  • Row counts reconcile at every stage of the pipeline
  • Schema and data types match the specification
  • Every transformation rule has at least one test case
  • Edge cases (nulls, empty strings, boundaries) have been tested
  • Regression checks confirm no unintended changes
  • Failed checks have severity levels and affected record counts
  • Recommendations are specific and actionable
  • Idempotency has been verified for rerunnable pipelines

Edge Cases

  • CDC (Change Data Capture) pipelines: Validate insert/update/delete operations separately; verify soft deletes and tombstone handling
  • Late-arriving data: Test that reprocessing or backfill correctly updates target without duplicates
  • Schema evolution: Validate that added/removed/renamed source columns are handled gracefully
  • Multi-source merges: Test conflict resolution logic when sources disagree on the same entity
  • Partitioned tables: Verify partition pruning works and data lands in the correct partition
  • Timezone-sensitive data: Test with data spanning DST transitions and multiple timezones
  • Large volume loads: Validate performance does not degrade and no timeouts occur at scale
  • Null propagation: Trace how NULL values flow through joins, aggregations, and calculations
保存したスキル