Skip to content

Commit db9fce8

Browse files
authored
Add missing where clause to cte (#5453)
1 parent 931e759 commit db9fce8

4 files changed

+4
-0
lines changed

koku/masu/database/trino_sql/gcp/openshift/reporting_ocpgcpcostlineitem_daily_summary.sql

+1
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ WITH cte_rankings AS (
414414
SELECT pds.gcp_uuid,
415415
count(*) as gcp_uuid_count
416416
FROM hive.{{schema | sqlsafe}}.reporting_ocpgcpcostlineitem_project_daily_summary_temp AS pds
417+
WHERE pds.ocp_source = {{ocp_source_uuid}} AND year = {{year}} AND month = {{month}}
417418
GROUP BY gcp_uuid
418419
)
419420
SELECT pds.gcp_uuid,

koku/masu/database/trino_sql/gcp/openshift/reporting_ocpgcpcostlineitem_daily_summary_resource_id.sql

+1
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ WITH cte_rankings AS (
636636
SELECT pds.gcp_uuid,
637637
count(*) as gcp_uuid_count
638638
FROM hive.{{schema | sqlsafe}}.reporting_ocpgcpcostlineitem_project_daily_summary_temp AS pds
639+
WHERE pds.ocp_source = {{ocp_source_uuid}} AND year = {{year}} AND month = {{month}}
639640
GROUP BY gcp_uuid
640641
)
641642
SELECT pds.gcp_uuid,

koku/masu/database/trino_sql/reporting_ocpawscostlineitem_daily_summary.sql

+1
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,7 @@ WITH cte_rankings AS (
11351135
SELECT pds.aws_uuid,
11361136
count(*) as aws_uuid_count
11371137
FROM hive.{{schema | sqlsafe}}.reporting_ocpawscostlineitem_project_daily_summary_temp AS pds
1138+
WHERE pds.ocp_source = {{ocp_source_uuid}} AND year = {{year}} AND month = {{month}}
11381139
GROUP BY aws_uuid
11391140
)
11401141
SELECT pds.aws_uuid,

koku/masu/database/trino_sql/reporting_ocpazurecostlineitem_daily_summary.sql

+1
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,7 @@ WITH cte_rankings AS (
819819
SELECT pds.azure_uuid,
820820
count(*) as azure_uuid_count
821821
FROM hive.{{schema | sqlsafe}}.reporting_ocpazurecostlineitem_project_daily_summary_temp AS pds
822+
WHERE pds.ocp_source = {{ocp_source_uuid}} AND year = {{year}} AND month = {{month}}
822823
GROUP BY azure_uuid
823824
)
824825
SELECT pds.azure_uuid,

0 commit comments

Comments
 (0)