Request a demo
← All articles How it works

How row-level validation works: beyond row counts

What InsightAutoHub compares when it validates a migrated table: counts with filters, column types from both catalogues, type-aware normalisation of every value, and a row-by-row match that tells you exactly what differs.

Row counts are the first check in every migration and the weakest. Two tables can have the same number of rows and still differ in every one of them: a timezone shift, a truncated string, a decimal rounded on the way. InsightAutoHub validates the data itself, and is careful about the opposite problem too: reporting a mismatch where the values are really the same, written differently by two engines.

In short

Pick a table, or write a query, on each side. InsightAutoHub counts both sides (with an optional filter), reads each column's type from both catalogues, normalises every value by type, and compares the shared columns row by row. You get source, target and matching record counts, a match rate, the rows that differ, and an Excel export.

1. Choose what to compare

Choose a source location, schema and table, and the same on the target (the Data Validation screen lays these out, and the same request can be sent through the validation API). Each side can take a custom query instead, to compare a slice (one month, one region) or to select columns in a fixed order; with no query, a default SELECT of the table is used. The comparison engine also accepts a deliberately simple filter applied to both default selects (column operator value, such as region = 'WEST'; anything more complex is rejected rather than run); on the screen, a slice is written as the same condition in each side's query.

The Data Validation configuration with Source Configuration and Target Configuration panels, each with location, schema, table and an optional query.
Source and target, each with an optional query, then Compare.

2. Read the types from both sides

Before comparing values, InsightAutoHub reads each column's declared type from the source catalogue (information_schema.columns on Redshift) and the target catalogue (all_tab_columns on Oracle). The types decide how each value is normalised. If either side cannot be read, comparison falls back to a careful text comparison rather than failing.

3. Normalise, then compare

Kind of valueTreated as equal whenExample (illustrative)
NULLsBoth sides are null, empty or the text NULLNULL and ''
NumbersThey are the same number once formatting and trailing zeros are set aside12.5 and 12.500000000
Dates and timestampsThey parse to the same moment, whatever the format2026-03-01 00:00:00 and 01-MAR-26
BooleansBoth are true-like or both false-liket, true, Y, yes
TextThey match after trimming spaces, ignoring case'West ' and 'WEST'
Arrays and structsEvery element or key matches, recursivelyJSON-like values

Only columns present on both sides are compared (names are matched case-insensitively), and any columns listed as excluded in the validation request are left out: load timestamps, surrogate keys generated by the target, columns you know will differ by design.

4. Row by row, in order

Comparison is positional: row 1 on the source against row 1 on the target, and so on. That makes it exact and fast, and it means both queries must sort the same way. Add an ORDER BY on the table's key to both sides. A different number of rows is itself a failure, and the summary shows both counts.

The most common false failure is two queries without the same ORDER BY. If the match rate is near zero but the counts agree, check the sort before anything else.

Why one missing row can fail a whole table

Because the comparison is positional, an early difference in row count shifts everything after it. An illustration with made-up figures: a source of 10,000 rows and a target of 9,999, where the missing row sorted at position 40. Rows 1 to 39 match; from row 40 on, each source row is compared with the target row that follows it, and almost nothing matches. The match rate looks like a disaster when the real problem is one row.

Read the result in this order: first the two counts (equal or not), then the match rate. If the counts differ, find the missing or extra rows before reading anything else, for example with a query on each side that counts by day or by partition key. Once the counts agree, a low match rate means values differ, and the side-by-side rows show which columns.

Where normalisation needs your help

Normalisation is designed to prevent false failures, and that has a cost in the other direction. Knowing these keeps it from hiding a real one:

  • Values that look like numbers are compared as numbers. A code that lost its leading zeros (02134 and 2134) compares equal. For code columns, add LENGTH(code) to both queries.
  • Very long numeric identifiers are compared through floating point, which keeps about 15 to 16 significant digits. Two 19-digit ids differing in the last digit can compare equal. Prefix such ids with a letter in both queries so they are compared as text.
  • Booleans and numeric flags are not the same thing. t, true, y and yes all read as true, but 1 reads as the number 1. If a Redshift BOOLEAN became NUMBER(1) on ADW, select CASE WHEN flag THEN 1 ELSE 0 END on the Redshift side so both are numbers. The folding also means a one-character status code of Y equals one of yes.
  • Types are read for the named table. A computed column in a custom query has no declared type and is compared by the general rules; give it the same name and form on both sides.
  • Check the columns compared. Only columns with the same name on both sides are compared. If a column was renamed, alias it in one query so the names line up, and confirm the list of compared columns in the result.

5. Read and keep the result

The result holds source records, target records, matching records and the match rate, and the rows that differ, side by side. The export endpoint produces the Excel evidence for the sign-off pack: keep one export per table per run.

The Excel report produced by the validation API has a summary sheet (locations, table, schemas, source and target row counts, matched rows, PASS or FAIL, the columns compared, the columns excluded and a timestamp), a sheet each with the rows read from the source and the target, and a side-by-side sheet of the first hundred rows. A table passes only when the counts are equal and every row matches.

Where people stay in charge

InsightAutoHub compares and reports; people decide. A person reviews every mismatch and decides whether it is a defect or a difference by design. Business owners confirm the data is right for its purpose, and reports and pipelines that read the table get their own checks (see the sign-off checklist). Nothing is cut over until a named person signs off with the evidence in hand.
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