Table Diff diffs the tables a second time to show failed rows
Author: harshachCreated Oct 1, 2026Updated Oct 1, 2026
Problem
When a Table Diff test fails, the tables are diffed a second time just to show some of the differing rows:
- OpenMetadata's
TableDiffValidator._runruns a new diff for a 10-row debug log of failed rows. - Collate's failed-rows sample (
fetch_failed_rows_sample) runs one for 50 rows.
That second diff stops once it has its rows (since collate-data-diff 0.11.17), but until then it re-runs the key-range queries and checksums. On a large table where few rows differ, that's close to a second full pass over both databases.
Fix
Keep the first differing rows while the test counts the diff. collate-data-diff gains get_stats_dict(sample_size=...) (https://github.com/open-metadata/collate-data-diff/pull/38); the validator keeps those rows as failed_rows_sample for the debug log and for Collate.
Source: open-metadata/OpenMetadata