From dc6122e04b98cce8f28bd7995a949174b5a5cb70 Mon Sep 17 00:00:00 2001 From: dmdesimone Date: Mon, 9 Dec 2024 19:30:06 -0500 Subject: [PATCH 1/2] UHM-8302 Basic summary of most recent PETL run --- .../views/current_pipeline_summary.sql | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 jobs/sql/derivations/views/current_pipeline_summary.sql diff --git a/jobs/sql/derivations/views/current_pipeline_summary.sql b/jobs/sql/derivations/views/current_pipeline_summary.sql new file mode 100644 index 0000000..6523356 --- /dev/null +++ b/jobs/sql/derivations/views/current_pipeline_summary.sql @@ -0,0 +1,44 @@ +DROP VIEW if exists current_pipeline_summary; +CREATE VIEW current_pipeline_summary AS +select max(cast(jparent.initiated as date)) as run_date, + max(j.status) as status, + count(*) as count, + null as description, + null as error_message, + min(j.started) as started, + max(j.completed) as completed, + null as uuid, + null as parent_child, + max(jparent.uuid) as parent_uuid +from petl_job_execution j +inner join petl_job_execution jparent on jparent.uuid = + (select top 1 uuid from petl_job_execution pje + where description in ('Refreshing HUMCI data','Refreshing ZL data') + order by initiated desc) +where j.initiated >= jparent.initiated +and j.status = 'SUCCEEDED' +group by j.status + +union + +select cast(jparent.initiated as date), + j.status, + null, + j.description, + j.error_message, + j.started, + j.completed, + j.uuid, +CASE + when ((j.description like 'Importing from%' and j.description like '% to %') or (j.description like 'Creating derived%')) + then 'child' + else 'parent' +END, +jparent.uuid as parent_uuid +from petl_job_execution j +inner join petl_job_execution jparent on jparent.uuid = + (select top 1 uuid from petl_job_execution pje + where description in ('Refreshing HUMCI data','Refreshing ZL data') + order by initiated desc) +where j.initiated >= jparent.initiated +and j.status <> 'SUCCEEDED'; From f5b5e5ac91f15bc9b4db60b2f44e4b7c6fbfb6ff Mon Sep 17 00:00:00 2001 From: dmdesimone Date: Fri, 13 Dec 2024 10:15:38 -0500 Subject: [PATCH 2/2] UHM-8302-Basic-summary-of-most-recent-PETL-run --- jobs/refresh-derived-tables.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/jobs/refresh-derived-tables.yml b/jobs/refresh-derived-tables.yml index 02e11ea..8de70ec 100644 --- a/jobs/refresh-derived-tables.yml +++ b/jobs/refresh-derived-tables.yml @@ -2,6 +2,13 @@ type: "job-pipeline" description: "Refresh Derived Tables" configuration: jobs: + - type: "iterating-job" + description: "Create destination views and functions" + configuration: + jobTemplate: + path: "create-derived-table-in-warehouse.yml" + iterations: + - tableName: "current_pipeline_summary" - type: "iterating-job" description: "Create derived setup tables" configuration: