Athena Query for Carbon footprint data

26 views
Skip to first unread message

Cameron Drotsky

unread,
Mar 22, 2024, 8:57:07 AMMar 22
to Cloud Carbon Footprint
Hi all, 

Struggling to get this query to run:

SELECT
line_item_product_code as serviceName,
product_region as region,
line_item_usage_type as usageType,
pricing_unit as usageUnit,
product_vcpu as vCpus
FROM <your-cost-and-usage-reports-table>
WHERE line_item_line_item_type IN ('Usage', 'DiscountedUsage', 'SavingsPlanCoveredUsage')
AND line_item_usage_start_date >= DATE('YYYY-MM-DD')
AND line_item_usage_start_date <= DATE('YYYY-MM-DD')
GROUP BY 1, 2, 3, 4, 5
Keep getting this error: INVALID_CAST_ARGUMENT: Value cannot be cast to date: YYYY-MM-DD

Please could anyone assist if they managed to figure this out?

Cloud Carbon Footprint

unread,
Mar 25, 2024, 3:06:28 PMMar 25
to Cloud Carbon Footprint
Hi Cameron,

It looks like you may have to replace the YYYY-MM-DD with the actually start dates that you need to use. We could consider updating our documentation to reflect this. Please let us know if this helps!

Thanks,
The CCF Team at Thoughtworks

Cameron Drotsky

unread,
Mar 26, 2024, 8:19:23 AMMar 26
to Cloud Carbon Footprint
Thank you for the help! 

I think that would help, but only if there is capacity to do so!

Thanks again,
Cameron
Reply all
Reply to author
Forward
0 new messages