Detect and fix schema drift (zero-loss)
Partner files change. A new column appears in next week's CSV, nobody told you, and a naïve pipeline silently drops it. DataChord handles this two ways at once:
- Zero-loss capture — every source column that isn't mapped (including a
brand-new one) is swept into an
_extraJSON column on your destination, so no data is ever lost, even on the very first run the column shows up. - Governed promotion — that same new column raises a drift event and a
proposal you review. Approving it registers the column as
UNMAPPEDso you can map it to a first-class target field. You approve every change — the pipeline keeps running and losing nothing in the meantime.
By the end of this page you will have:
- Pointed a CSV source at a watched folder and enabled drift detection.
- Confirmed a brand-new column lands in
_extraon the first run (zero loss). - Reviewed and approved a drift proposal, then promoted the new column.
- Scheduled the whole loop to run unattended.
- A MapCraft project on the document lane with at least one saved mapping
(open
/flowbridge/{projectId}— create the mapping first if prompted). - A CSV source whose
connector_typeisfile, pointing at a local/mounted path (e.g./data/incoming/orders.csv). Object storage (S3/SFTP) is a separate connector and out of scope here. - A destination configured on the Deliver node — PostgreSQL, Snowflake, or
BigQuery.
_extralands asJSONB(Postgres),VARIANT(Snowflake), or an autodetectedSTRUCT(BigQuery).
Step 1 — Enable drift detection
Open FlowBridge → Drift for your project and click Enable drift detection.
This does two things in one recompile:
- Turns on the zero-loss
_extrapassthrough for the project's mapping(s). - Adds a
schema_drifthealth-check to the DAG, with its baselineexpected_fieldsseeded automatically from your source schema — no hand-editing of DAG JSON.
The confirmation tells you how many baseline fields were captured and the new
DAG version. (Equivalent API: POST /api/v1/drift/projects/{projectId}/enable.)
Step 2 — Run it and confirm zero loss
Trigger a run (manually from the canvas, or wait for the schedule in Step 4).
Drop a CSV that contains a column your mapping doesn't cover — say
shipping_address — and let the pipeline run.
Open your destination table. The mapped columns are populated as usual, and the
unmapped column is preserved inside _extra:
{
"order_id": "1001",
"total": "49.90",
"_extra": { "shipping_address": "12 Park St, Kolkata" }
}
Nothing was dropped — and you haven't had to touch the mapping yet.
Step 3 — Review and approve the drift, then promote the column
The same run that captured shipping_address records a drift event. Because
this is an additive change (a new column, nothing removed), DataChord builds the
proposal deterministically — no LLM — and leaves it PENDING_REVIEW.
Example drift event diagnostic
{
"missing_fields": [],
"extra_fields": ["shipping_address"],
"sample_size": 100
}
On FlowBridge → Drift, select the event and review the proposal card (rationale, confidence, and the patch diff). Click Approve. Approving:
- Advances the drift baseline so the alert clears and won't re-fire.
- Registers
shipping_addressin the source schema. - Adds it as an
UNMAPPEDrow in the MapCraft table.
Open MapCraft, map shipping_address to a target field, and save. On the next
run it becomes a first-class column and drops out of _extra.
A removed or malformed field (missing columns, validator errors) is a breaking change — those keep flowing through the LLM self-healing fix-proposer, which proposes a DAG patch for you to review. Only additive drift uses the deterministic path above.
Step 4 — Schedule it
Open FlowBridge → Schedule, add a cadence, and let the loop run unattended:
- Daily
- Interval
Cadence: Cron
Expression: 0 2 * * * (every day at 02:00)
Enabled: ✔
Cadence: Fixed interval
Seconds: 900 (every 15 minutes)
Enabled: ✔
Each scheduled run re-reads the CSV, sweeps any unmapped columns into _extra,
and raises a drift event for anything new — so the data keeps landing and you
stay in control of what gets promoted.
Verify
- A new column in the CSV appears inside
_extraon the destination on the first run — before you map anything. - A
schema_driftevent with that column inextra_fieldsshows on the Drift page, with aPENDING_REVIEWproposal. - Approving the proposal adds an
UNMAPPEDrow in MapCraft and clears the alert. - After you map the column, the next run promotes it to a real column.