Skip to content

Commit

Permalink
Getting latest memory and vcpu values.
Browse files Browse the repository at this point in the history
  • Loading branch information
bacciotti committed Nov 13, 2024
1 parent 524566a commit b3d7d94
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ cte_latest_values as (
nullif(product_instancetype, '') as instance_type,
max(json_extract_scalar(json_parse(resourcetags), '$.Name')) AS instance_name,
resourcetags as tags,
costcategory as cost_category
costcategory as cost_category,
nullif(product_memory, '') as memory,
cast(nullif(product_vcpu, '') AS INTEGER) as vcpu
FROM hive.{{schema | sqlsafe}}.aws_line_items_daily as alid
WHERE source = '{{source_uuid | sqlsafe}}'
AND year = '{{year | sqlsafe}}'
Expand All @@ -65,7 +67,9 @@ cte_latest_values as (
lineitem_resourceid,
product_instancetype,
resourcetags,
costcategory
costcategory,
product_memory,
product_vcpu
)

SELECT uuid() as uuid,
Expand All @@ -77,8 +81,8 @@ SELECT uuid() as uuid,
cte_l.instance_type,
operating_system,
region,
vcpu,
memory,
cte_l.vcpu,
cte_l.memory,
cast(
map_filter(
cast(json_parse(cte_l.tags) as map(varchar, varchar)),
Expand Down

0 comments on commit b3d7d94

Please sign in to comment.