From 69aaa21fdbc081ccbb94dd197440117301f0b73e Mon Sep 17 00:00:00 2001 From: sacundim Date: Sun, 30 Jun 2024 10:51:50 -0700 Subject: [PATCH] Missed the DuckDB template for the Biostatistics flu cases download --- .../templates/biostatistics/flu-cases.sql.j2 | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 downloader/src/covid_19_puerto_rico_downloader/templates/biostatistics/flu-cases.sql.j2 diff --git a/downloader/src/covid_19_puerto_rico_downloader/templates/biostatistics/flu-cases.sql.j2 b/downloader/src/covid_19_puerto_rico_downloader/templates/biostatistics/flu-cases.sql.j2 new file mode 100644 index 0000000000..6197404a94 --- /dev/null +++ b/downloader/src/covid_19_puerto_rico_downloader/templates/biostatistics/flu-cases.sql.j2 @@ -0,0 +1,23 @@ +COPY ( + SELECT + *, + TIMESTAMP '{{ downloaded_at }}' AS downloadedAt + FROM read_json( + '{{ input_file }}', + format='array', + union_by_name=true, + columns={ + caseId: 'STRING', + caseCategory: 'STRING', + patientAgeRange: 'STRING', + patientSex: 'STRING', + patientPhysicalCity: 'STRING', + identifyingTestSampleCollectedDate: 'DATE' + } + ) + ORDER BY + identifyingTestSampleCollectedDate +) +TO '{{ output_parquet }}' ( + FORMAT 'parquet', COMPRESSION 'GZIP' +); \ No newline at end of file