Request a demo
← All articles Use case

Use case: validating sensitive tables by slice for a healthcare analytics team

A worked example for teams moving patient or member data: comparing large tables one slice at a time, choosing columns with a query, ordering by key, and keeping validation evidence without spreading sensitive values.

Healthcare data teams migrate under two pressures at once. The data has to arrive intact, because claims analytics, quality measures and capacity planning depend on it; and every copy, export and screenshot of it is a privacy question. Validation has to be thorough without becoming one more place where sensitive values are spread around. This example shows how a made-up analytics team does both with InsightAutoHub.

Example ยท a made-up regional health network

Brightwater Health's analytics warehouse

Brightwater Health (fictional) runs analytics on a Redshift warehouse of encounters, claims and member eligibility, and is moving it to Oracle ADW. The largest table holds several years of encounters. Elena, the analytics engineering lead, needs to prove the migration to the data governance committee, and must keep identifiable values out of the evidence pack.

In short

Validate large tables one slice at a time with the same condition on both sides; use a query on each side to choose the columns compared, ordered by key; leave out columns that differ by design; and file the summary figures as evidence, keeping row-level differences inside the governed environment.

1. Check the types first

Before any data moves, the datatype mapping report runs on the encounter, claim and eligibility tables. Two conversions need attention: a timestamp column whose time zone handling differs between the two engines, and a long free-text clinical note field. The note field is out of scope for analytics and is not migrated.

The Datatype Mapping configuration with a Redshift source and an Oracle target, each with location, schema and table selectors, and an optional table filter.
Datatype mapping on a Redshift source and an Oracle ADW target, before any data moves.

2. Validate by slice

Comparing years of encounters in one pass is slow, and a single failure says nothing about where to look. Elena's team validates each slice separately, with the same condition on both sides (one service year, or half-year, at a time) in each side's query, so each comparison is small and each result points at a period.

3. Choose the columns with a query

Instead of comparing every column, each side gets a query that selects the analytic columns in the same order, sorted by the encounter key, for example SELECT encounter_id, member_key, service_date, place_of_service, allowed_amount FROM encounters WHERE service_year = 2024 ORDER BY encounter_id. The ORDER BY on both sides is what makes the row-by-row comparison meaningful. Columns that differ by design, such as the load timestamp written by the new pipeline, are left out.

Column typeHow the comparison treats itWhy it matters here
Dates and timestampsCompared as moments, whatever the formatService dates written differently by two engines still match
AmountsCompared as numbers, by valueNo false failures from trailing zeros
NULLsNull, empty and the text NULL are the sameOptional fields do not fail on representation
CodesTrimmed and compared case-insensitivelyPadding differences in code columns do not fail

4. Keep the evidence, not the data

For each slice, the summary (source records, target records, matching records, match rate) goes into the governance pack. The Excel report is kept only inside the governed environment, because it contains the rows read from both sides (a sheet for each), not only the differences. In Brightwater's case the one slice below 100% traced back to time zone handling on a timestamp column; the fix was made in the load and that slice was re-run.

Comparing less, proving the same

The comparison reads every row and column each query returns, and the report keeps them. So the most effective privacy control is the query itself. Elena's team uses three techniques, in this order of preference:

  1. Leave identifiers out where the key will do. Compare the encounter key, dates, codes and amounts; leave names, addresses and free text out of the query entirely. The comparison still proves the analytic columns arrived intact.
  2. Compare aggregates for the most sensitive slices. A query on each side that returns one row per service day (count of encounters, sum of allowed amount), ordered by day, is compared exactly like a table. It proves completeness and totals without a single member-level value in the report.
  3. Compare a hash only with care. Hashing an identifier on each side looks attractive, but the two engines must produce the same text before hashing (case, padding, date format) and use the same algorithm. Test it on a known sample first; a hash mismatch says only that something differs, never what.
ApproachProvesSensitive values in the report
Full columnsEvery value arrived intactYes
Analytic columns onlyThe columns analytics depends on arrived intactFewer, by design
Daily aggregatesCompleteness and totals per dayNone at member level

Most tables end up with a mix: analytic columns for the routine slices, aggregates for the slices the governance committee is most concerned about, and a full-column comparison only where a specific discrepancy is being investigated.

Validation is general information, not compliance advice. Whether a validation export may contain identifiable data, and where it may be stored, is a question for your privacy and compliance teams under the rules that apply to you (for example HIPAA in the United States).

What Elena reports to governance

  • Tables in scope and the agreed type conversions.
  • For each table, each slice's counts and match rate, and the date the comparison was run.
  • Every slice below 100%, its cause, the fix and the re-run result.
  • Columns excluded from comparison, and why.
  • The query used for each slice, so the committee can see exactly what was compared.

Questions governance committees ask

Who can run a validation?

Any signed-in user can run a validation against the locations configured in the deployment. Limit who has an account on a deployment connected to production, as you would for any tool that reads the warehouse.

Where do the reports go?

Wherever the person running them saves them. Agree a governed location for reports before the first run, and a retention period that matches the rest of the migration records.

Does a 100% match mean the data is correct?

It means the target holds what the source held, for the columns compared. Whether the source was right is a separate, older question.

Can validation run on masked copies instead?

Only if the same deterministic masking is applied on both sides. Otherwise every masked column differs by construction, and the comparison proves nothing about it. Comparing real values with a narrow column list is usually simpler to defend.

Related: a sign-off checklist for any migration.

See it on your own migration

Bring one schema you need to move

We'll map its types, plan the tables and validate a sample end to end with your team, as a hosted trial or inside your own cloud.

Request a demo