Verify that two serialisations of a table hold identical data
Source:R/11_write_table_output.R
verify_table_output.RdCompares a CSV and a Parquet file cell for cell without assuming either has a unique key. Both are read all-VARCHAR, every row is hashed, and the hashes are aggregated in sorted order, so the digest is independent of row order and of ties.
Details
Ordering by OBJECTID is not sufficient for a whole-table digest. In
F9-P07-T02-CONTRACTORS-2023 there are 299,205 rows but only 215,278
distinct OBJECTID values, so any ORDER BY OBJECTID aggregate is
non-deterministic among ties and reports a spurious mismatch. Hashing rows and
sorting the hashes removes the need for a key at all.
fold_empty = TRUE compares the CSV as every reader actually sees it, which
is the behaviour normalize_empty = TRUE in write_table_output() targets.