Contract
- Input: source data descriptions, target schema, quality requirements.
- Output: pipeline architecture + quality rules + schema evolution.
- Side effects: may process data when executed (read-only or write to target).
- Dependencies: source access, target access.
- Stop condition: architecture saved; quality rules defined.
- Risk: medium — data corruption risks; requires testing.
- Boundary: defines pipeline; execution requires approval.
ETL Pipeline Design
Design an ETL / ELT pipeline — extraction, transformation, load — with reproducible steps, schema evolution, and data quality checks.
Process
1. Source analysis
- Source type: database (SQL / NoSQL), file (CSV / JSON / Parquet / ORC), API (REST / GraphQL / gRPC), stream (Kafka / Kinesis / Pub/Sub).
- Schema: columns, types, constraints.
- Frequency: batch (hourly / daily) or streaming (near real-time).
- Volume: rows / GB per run.
- Quality issues: missing values, out-of-range, duplicates, format errors.
Completion criterion: source profile saved.
2. Transformation design
- Filter: remove rows that don't meet criteria.
- Clean: fix types, trim whitespace, standardise formats.
- Aggregate: group by key, compute statistics.
- Enrich: join with reference data (customer, product, geography).
- Deduplicate: exact / fuzzy / probabilistic.
Completion criterion: transformation steps documented.
3. Load design
- Target type: warehouse (Snowflake / BigQuery / Redshift / Databricks) vs database vs lake.
- Load strategy: full refresh (replace all) / incremental (append new / update changed) / merge (upsert).
- Partition / clustering strategy for performance.
- Backfill plan for historical data.
Completion criterion: load strategy saved.
4. Data quality
- Null rate per column (threshold: < X%).
- Out-of-range checks (min / max / expected range).
- Duplicate rate.
- Referential integrity (foreign key consistency).
- Freshness (data delay from source to target).
Completion criterion: quality rules saved with thresholds and actions (fail / warn / fix).
5. Schema evolution
- How to handle new columns (add, ignore, raise error).
- How to handle renamed / deleted columns.
- Versioning: schema registry (e.g. Confluent Schema Registry, AWS Glue Data Catalog).
Completion criterion: evolution plan saved.
1---2name: data-etl-pipeline3description: Design ETL / ELT pipelines — extraction, transformation, load — with reproducible steps, schema evolution, quality checks, and observability.4---56## Contract78- **Input:** source data descriptions, target schema, quality requirements.9- **Output:** pipeline architecture + quality rules + schema evolution.10- **Side effects:** may process data when executed (read-only or write to target).11- **Dependencies:** source access, target access.12- **Stop condition:** architecture saved; quality rules defined.13- **Risk:** medium — data corruption risks; requires testing.14- **Boundary:** defines pipeline; execution requires approval.1516# ETL Pipeline Design1718Design an **ETL / ELT pipeline** — extraction, transformation, load — with reproducible steps, schema evolution, and data quality checks.1920## Process2122### 1. Source analysis23- Source type: database (SQL / NoSQL), file (CSV / JSON / Parquet / ORC), API (REST / GraphQL / gRPC), stream (Kafka / Kinesis / Pub/Sub).24- Schema: columns, types, constraints.25- Frequency: batch (hourly / daily) or streaming (near real-time).26- Volume: rows / GB per run.27- Quality issues: missing values, out-of-range, duplicates, format errors.2829**Completion criterion:** source profile saved.3031### 2. Transformation design32- Filter: remove rows that don't meet criteria.33- Clean: fix types, trim whitespace, standardise formats.34- Aggregate: group by key, compute statistics.35- Enrich: join with reference data (customer, product, geography).36- Deduplicate: exact / fuzzy / probabilistic.3738**Completion criterion:** transformation steps documented.3940### 3. Load design41- Target type: warehouse (Snowflake / BigQuery / Redshift / Databricks) vs database vs lake.42- Load strategy: full refresh (replace all) / incremental (append new / update changed) / merge (upsert).43- Partition / clustering strategy for performance.44- Backfill plan for historical data.4546**Completion criterion:** load strategy saved.4748### 4. Data quality49- Null rate per column (threshold: < X%).50- Out-of-range checks (min / max / expected range).51- Duplicate rate.52- Referential integrity (foreign key consistency).53- Freshness (data delay from source to target).5455**Completion criterion:** quality rules saved with thresholds and actions (fail / warn / fix).5657### 5. Schema evolution58- How to handle new columns (add, ignore, raise error).59- How to handle renamed / deleted columns.60- Versioning: schema registry (e.g. Confluent Schema Registry, AWS Glue Data Catalog).6162**Completion criterion:** evolution plan saved.