Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2024 11:58 PM
@radothede, I've clarified this with Databricks and my assumption was correct. The formula
sum(usage_quantity * list_prices.pricing.default)is only right, if the time window in the usage table is 1 hour. For every window that is not 1 hour, the fraction of the used hour needs to be calculated and multiplied with the usage_quantity. So something like this might be the correct formula:
select ((unix_timestamp(usage_end_time) - unix_timestamp(usage_start_time))/3600) * usage_quantity as DBU_hours, * from system.billing.usage