ETL & integration
ETL and integration roles move data between systems reliably: from operational databases, partner files and APIs into the warehouse, and sometimes back out. Interviews are SQL-heavy and scenario-driven: "a file arrived late", "3% of rows were rejected", "implement this mapping", "rerun yesterday's load safely". Coding is usually lighter than for platform roles; questions about specific tools are common.
The load patterns
| Pattern | How it works | Use when | Watch out for |
|---|---|---|---|
| Full reload | Truncate and reload everything | Small tables, or no reliable change marker | Cost and runtime as data grows; a brief empty table unless you swap atomically |
| Incremental by watermark | Pull rows with updated_at after the last successful run | The source has a trustworthy update timestamp | Late or backdated updates; equal timestamps at the boundary (overlap a little and upsert) |
| CDC | Read the database's change log (inserts, updates, deletes) | Large or busy tables, or you need deletes | Ordering, schema changes, the initial snapshot |
| File feeds | Partners or systems drop files on a schedule | External parties, legacy systems | Missing, late, duplicate or truncated files; layout changes |
Whatever the pattern, make the load idempotent: running it twice for the same input gives the same result (upsert by key, or overwrite the date partition in one transaction). Resends, retries and backfills then become routine.
Validation and rejects
- File-level checks first: the expected file arrived, once, on time, complete (header and trailer counts or a manifest), with the right layout. If any fails, stop the whole file.
- Row-level checks: required keys present, types and formats parse, codes are known. Give each rejected row one reason in a defined order.
- Quarantine, don't drop. Write rejects to a table with file, line number, reason and the raw content, report them to the source, and reprocess fixed rows.
- Threshold. Load the valid rows only if the reject rate is normal. A spike usually means a format change, and loading the rest would publish a partial picture.
Change detection and upserts
- Deduplicate first: one row per key (the latest), or
MERGEwill fail or behave unpredictably. - Trim and normalize keys before matching, or padded codes become new records.
- Compare NULL-safely:
a <> bis NULL when either side is NULL. UseIS DISTINCT FROM,COALESCEon both sides, or a row hash. - Type 1 vs type 2: overwrite changed attributes, or close the current version and insert a new one. See the SCD cheatsheet.
ETL tools and ELT
Traditional ETL tools are visual and run transformations on their own servers:
- Informatica PowerCenter: mappings run by sessions inside workflows.
- SSIS: packages with control flows and data flows.
- Azure Data Factory: pipelines of activities, plus mapping data flows.
Pushdown turns parts of a mapping into SQL that runs in the database instead. ELT loads raw data first and transforms it with SQL in the warehouse (often with dbt), so transformations scale with the warehouse, are versioned and tested, and can be rerun from raw data.
Schedulers such as Control-M and Autosys often hold the real dependency graph, so include them in any migration inventory.
Practice on messy files
The integration dataset in the SQL playground is a month of raw daily CRM files exactly as an ETL team receives them. It has a missing day, a resent file, late and truncated deliveries, and lines with blank codes, bad emails and unparseable timestamps. The SQL questions below use it.
- Validate a raw feed and count rejects by reason
- Check a month of feed files for missing, late and broken deliveries
- Decide insert, update or unchanged for an incremental load
- Parse a fixed-width file with a layout spec and a reject list
- ETL tools (Informatica, SSIS, Data Factory) and moving to ELT
- Design a reliable partner file ingestion pipeline
Related questions elsewhere in the bank:
- Read a large CSV in fixed-size batches with a generator
- Fetch every page from a flaky paginated API
- An idempotent batch upsert writer
- Build an SCD Type 2 table from a change log
- Replicate a production Postgres into the lakehouse with CDC
- Legacy (Teradata / Ab Initio) to cloud migration
Then try the incident drills "The partner's file didn't arrive" and "The reject rate jumped to 30%".
Common traps
- Loading a resent file on top of the original instead of replacing it.
- Assuming a file is complete because it exists; check the trailer or manifest.
- Loading late files under the arrival date instead of their business date.
CASTon raw text that fails the whole load on one bad value; use safe parsing and rejects.- Comparing columns with
<>when either side can be NULL.
Further reading
- AWS: ETL vs ELT: a short primer for the "why are teams moving to ELT?" question.
- Debezium: architecture: read this if you can't explain how log-based CDC gets changes out of a database.
- Maxime Beauchemin: functional data engineering: the case for idempotent, partition-overwrite loads, from the creator of Airflow.