issue related mismatch count

Vineet S 1,410 Reputation points
2026-09-02T10:47:27.0833333+00:00

Hi Expert,

the flow starts from source to landing, source to reference , source to trans and source what are the best practices needs to follow

Azure Databricks
Azure Databricks

An Apache Spark-based analytics platform optimized for Azure.


Answer accepted by question author
Marcin Policht 106.8K Reputation points MVP Volunteer Moderator
2026-09-02T11:06:38.7033333+00:00

In Azure Databricks, when the same source feeds landing, reference, and transformation (trans) layers, you should establish a single, authoritative ingestion point. Load the source into the landing/raw layer first, capture the ingestion timestamp, batch/run ID, source record count, and checksum or other reconciliation metadata. Downstream reference and transformation processes should consume that controlled landing data rather than independently extracting from the source.

For the mismatch-count issue, implement record-count reconciliation at every stage: source → landing, landing → reference, and landing → trans. Store expected and actual counts, rejected/error counts, duplicate counts, and processed counts in an audit/control table. A pipeline should flag or fail when counts do not reconcile according to explicitly defined rules, rather than silently continuing.

Use Delta tables with ACID transactions, idempotent processing, and a consistent business key. Avoid relying solely on COUNT(*); also reconcile key fields, aggregates, and, where appropriate, hashes. Handle late-arriving data, deletes, duplicates, and retries explicitly. Each pipeline run should have a unique batch/run ID so records can be traced from the original source through every downstream layer.

The preferred pattern is essentially Source → Landing/Raw → Reference and Trans → Curated/Serving, with centralized audit/reconciliation between each layer. This prevents multiple independent reads of the source from producing different snapshots and makes a count mismatch much easier to isolate.


If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

hth

Marcin

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Newest

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.