The BigQuery demo (run_bigquery_demo()) builds a cohort and features in GoogleSQL. These functions run the same
steps on DuckDB and compare the answers, as the Python module omop_etl.backend_parity does with the same rules:
run_duckdb_demo(): the cohort from the native Circe compiler and the features frominst/sql/duckdb_demo_features.sql, the DuckDB twin ofbigquery_demo_features.sql.copy_demo_sample_from_bigquery(): copies every row of a fixed sample of persons (and theconcept_ancestorrows their events need) from BigQuery into DuckDB, so the cohort and features can be rebuilt locally and compared with the BigQuery tables for the same persons.compare_cohorts(),compare_features(),compare_column_types(),check_id_precision(),compare_demo_summaries()andcompare_demo_outputs(): the comparisons.
Ids are compared as exact decimal text. A 64-bit id read into a double is exact only up to 2^53 and one read into an
R integer only up to 2^31 - 1, so ids are kept as integer64 or text, and a double id at or above 2^53 is refused
rather than compared.
