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.
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.

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 value | Treated as equal when | Example (illustrative) |
|---|---|---|
| NULLs | Both sides are null, empty or the text NULL | NULL and '' |
| Numbers | They are the same number once formatting and trailing zeros are set aside | 12.5 and 12.500000000 |
| Dates and timestamps | They parse to the same moment, whatever the format | 2026-03-01 00:00:00 and 01-MAR-26 |
| Booleans | Both are true-like or both false-like | t, true, Y, yes |
| Text | They match after trimming spaces, ignoring case | 'West ' and 'WEST' |
| Arrays and structs | Every element or key matches, recursively | JSON-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.
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
(
02134and2134) compares equal. For code columns, addLENGTH(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,yandyesall read as true, but1reads as the number 1. If a RedshiftBOOLEANbecameNUMBER(1)on ADW, selectCASE WHEN flag THEN 1 ELSE 0 ENDon the Redshift side so both are numbers. The folding also means a one-character status code ofYequals one ofyes. - 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.


