Skip to content

Commit f0da219

Browse files
author
Amit Kothari (from Dev Box)
committed
Consumer ingestion updates
1 parent daaabda commit f0da219

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

docs/consumer-ingestion-guide.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ This is the exact logical flow a consumer should understand before operating or
5353
5. **Path selection**:
5454
- non-partitioned: latest row by `RunId`
5555
- partitioned: latest `RunId` per `Partition` (snapshot entries)
56-
6. **Checkpoint gate**: skip ingestion if `(DatasetName, Partition, RunId)` already exists in watermark.
56+
6. **Checkpoint gate**: skip ingestion if the effective watermark key already exists:
57+
- starter-kit style: `(RunId, Partition)` within the dataset-scoped run
58+
- shared-store style: `(DatasetName, RunId, Partition)`
5759
7. **Load pattern**: ingest into staging table, validate, swap/rename to main table, create/update view.
5860
8. **Commit checkpoint**: watermark is saved only after successful load.
5961

@@ -318,7 +320,7 @@ EXEC sp_rename '[dbo].[Staging_CDM_Products]', '[Main_CDM_Products]'
318320

319321
**Checkpoint storage for SQL:**
320322
- Create a `Checkpoint` table in same SQL database
321-
- Schema: `(DataProduct, DatasetName, Partition, RunId, LoadedAt, Status, ErrorMsg)`
323+
- Schema: `(DataProduct, DatasetName, RunId, Partition, LoadedAt, Status, ErrorMsg)`
322324

323325
#### Substitution pattern: Kusto → Snowflake
324326

@@ -350,17 +352,17 @@ ALTER TABLE CDM_Products
350352

351353
#### General rules for any substitution
352354

353-
1. **Idempotency**: Your target writer must handle rerun of same `(DatasetName, Partition, RunId)` without duplication.
354-
2. **Checkpoint deduplication**: Use all three components `(DatasetName, RunId, Partition)` as the dedup key - use `Partition` column value directly, not parsed from paths.
355+
1. **Idempotency**: Your target writer must handle rerun of the same effective key without duplication:
356+
- dataset-scoped style: `(RunId, Partition)`
357+
- shared-store style: `(DatasetName, RunId, Partition)`
358+
2. **Checkpoint deduplication**: Use the effective key for your execution model:
359+
- dataset-scoped style: `(RunId, Partition)`
360+
- shared-store style: `(DatasetName, RunId, Partition)`
361+
- in both cases, use the `Partition` column value directly, not parsed from paths
355362
3. **Staging pattern**: Use explicit staging layers to ensure atomicity of final write.
356363
4. **Validation**: Always validate (row count, checksum) before committing checkpoint.
357-
5. **Checkpoint storage**: Persist `(DataProductName, DatasetName, RunId, Partition, LoadedAt, Status)` in durable storage, using the exact `Partition` value from the index file.
358-
6. **Test reruns**: Verify that reruns do not increase row counts, and checkpoint prevents re-ingestion of the same `(DatasetName, RunId, Partition)` combination.
359-
360-
### Enhancement path B: Add first-class Delta ingestion support
361-
362-
Recommended approach:
363-
364+
5. **Checkpoint storage**: Persist the effective dedup key plus status metadata in durable storage, using the exact `Partition` value from the index file.
365+
6. **Test reruns**: Verify that reruns do not increase row counts, and checkpoint prevents re-ingestion of the same effective key.
364366
1. Add explicit ingestion policy per dataset (`SnapshotOnly`, `DeltaOnly`, `SnapshotPlusDelta`).
365367
2. For `SnapshotPlusDelta`, process latest snapshot baseline then apply unseen deltas in ordered `RunId`.
366368
3. Extend checkpoint schema to include `IngestionMode` and optional sequence ordering metadata.

0 commit comments

Comments
 (0)