From a7489f154ba0d988536a3ece575f977feebeedc0 Mon Sep 17 00:00:00 2001 From: "Reuven V. Gonzales" Date: Fri, 20 Dec 2024 01:49:16 +0000 Subject: [PATCH] attempt to reduce stages --- .../models/metric_names_from_artifact.sql | 8 ++++++++ .../models/metric_names_from_collection.sql | 8 ++++++++ .../models/metric_names_from_project.sql | 8 ++++++++ warehouse/metrics_mesh/models/metrics_v0.sql | 15 ++++++--------- 4 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 warehouse/metrics_mesh/models/metric_names_from_artifact.sql create mode 100644 warehouse/metrics_mesh/models/metric_names_from_collection.sql create mode 100644 warehouse/metrics_mesh/models/metric_names_from_project.sql diff --git a/warehouse/metrics_mesh/models/metric_names_from_artifact.sql b/warehouse/metrics_mesh/models/metric_names_from_artifact.sql new file mode 100644 index 00000000..55efa30f --- /dev/null +++ b/warehouse/metrics_mesh/models/metric_names_from_artifact.sql @@ -0,0 +1,8 @@ +MODEL ( + name metrics.metric_names_from_artifact, + kind FULL +); + +SELECT DISTINCT + metric +FROM metrics.timeseries_metrics_to_artifact \ No newline at end of file diff --git a/warehouse/metrics_mesh/models/metric_names_from_collection.sql b/warehouse/metrics_mesh/models/metric_names_from_collection.sql new file mode 100644 index 00000000..fe477492 --- /dev/null +++ b/warehouse/metrics_mesh/models/metric_names_from_collection.sql @@ -0,0 +1,8 @@ +MODEL ( + name metrics.metric_names_from_collection, + kind FULL +); + +SELECT DISTINCT + metric +FROM metrics.timeseries_metrics_to_collection \ No newline at end of file diff --git a/warehouse/metrics_mesh/models/metric_names_from_project.sql b/warehouse/metrics_mesh/models/metric_names_from_project.sql new file mode 100644 index 00000000..c2e30d94 --- /dev/null +++ b/warehouse/metrics_mesh/models/metric_names_from_project.sql @@ -0,0 +1,8 @@ +MODEL ( + name metrics.metric_names_from_project, + kind FULL +); + +SELECT DISTINCT + metric +FROM metrics.timeseries_metrics_to_project \ No newline at end of file diff --git a/warehouse/metrics_mesh/models/metrics_v0.sql b/warehouse/metrics_mesh/models/metrics_v0.sql index e864fe86..8c9d020c 100644 --- a/warehouse/metrics_mesh/models/metrics_v0.sql +++ b/warehouse/metrics_mesh/models/metrics_v0.sql @@ -4,17 +4,14 @@ MODEL ( ); WITH unioned_metric_names AS ( - SELECT DISTINCT - metric - FROM metrics.timeseries_metrics_to_artifact + SELECT * + FROM metrics.metric_names_from_artifact UNION ALL - SELECT DISTINCT - metric - FROM metrics.timeseries_metrics_to_project + SELECT * + FROM metrics.metric_names_from_project UNION ALL - SELECT DISTINCT - metric - FROM metrics.timeseries_metrics_to_collection + SELECT * + FROM metrics.metric_names_from_collection ), all_timeseries_metric_names AS ( SELECT DISTINCT metric