Skip to content

Commit

Permalink
Set data value to NULL for non-applicable direction
Browse files Browse the repository at this point in the history
If set to 0, the records will be inserted twice into the network summary tables
because that query is filtering on values where the field is not null, and zero
is not null.

Co-authored-by: Corey Goodfred <[email protected]>
  • Loading branch information
samdoran and cgoodfred committed Jul 22, 2024
1 parent 0db5b1d commit f75aad8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ INSERT INTO {{schema | sqlsafe}}.reporting_ocpusagelineitem_daily_summary (
'{"cpu": 0.000000000, "memory": 0.000000000, "storage": 0.000000000}'::jsonb as supplementary_usage_cost,
CASE
WHEN upper(data_transfer_direction) = 'IN' THEN sum(infrastructure_data_in_gigabytes)
ELSE 0
ELSE NULL
END as infrastructure_data_in_gigabytes,
CASE
WHEN upper(data_transfer_direction) = 'OUT' THEN sum(infrastructure_data_out_gigabytes)
ELSE 0
ELSE NULL
END as infrastructure_data_out_gigabytes,
0 as pod_usage_cpu_core_hours,
0 as pod_request_cpu_core_hours,
Expand Down

0 comments on commit f75aad8

Please sign in to comment.