From 13a33defd4e289911894cea9bb434c75a35153fa Mon Sep 17 00:00:00 2001 From: Michael Skarbek Date: Sat, 11 Jan 2025 21:54:18 -0500 Subject: [PATCH] missing where clause (#5442) --- .../trino_sql/reporting_ocpawscostlineitem_daily_summary.sql | 3 ++- .../trino_sql/reporting_ocpazurecostlineitem_daily_summary.sql | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/koku/masu/database/trino_sql/reporting_ocpawscostlineitem_daily_summary.sql b/koku/masu/database/trino_sql/reporting_ocpawscostlineitem_daily_summary.sql index 30b37611ad..e0d38b78e4 100644 --- a/koku/masu/database/trino_sql/reporting_ocpawscostlineitem_daily_summary.sql +++ b/koku/masu/database/trino_sql/reporting_ocpawscostlineitem_daily_summary.sql @@ -753,7 +753,8 @@ WITH cte_total_pv_capacity as ( AND strpos(aws.resource_id, ocp.csi_volume_handle) > 0 AND ocp.csi_volume_handle is not null AND ocp.csi_volume_handle != '' - WHERE ocp.year = {{year}} + WHERE ocp.source = {{ocp_source_uuid}} + AND ocp.year = {{year}} AND lpad(ocp.month, 2, '0') = {{month}} AND ocp.usage_start >= {{start_date}} AND ocp.usage_start < date_add('day', 1, {{end_date}}) diff --git a/koku/masu/database/trino_sql/reporting_ocpazurecostlineitem_daily_summary.sql b/koku/masu/database/trino_sql/reporting_ocpazurecostlineitem_daily_summary.sql index 374eeec9fe..3334947b70 100644 --- a/koku/masu/database/trino_sql/reporting_ocpazurecostlineitem_daily_summary.sql +++ b/koku/masu/database/trino_sql/reporting_ocpazurecostlineitem_daily_summary.sql @@ -508,7 +508,8 @@ WITH cte_total_pv_capacity as ( OR (lower(ocp.csi_volume_handle) = lower(azure.resource_id)) ) - WHERE ocp.year = {{year}} + WHERE ocp.source = {{ocp_source_uuid}} + AND ocp.year = {{year}} AND lpad(ocp.month, 2, '0') = {{month}} AND ocp.usage_start >= {{start_date}} AND ocp.usage_start < date_add('day', 1, {{end_date}})