How to allocate costs per SQL query?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2023 07:55 AM
By using System Tables (systen.billing.usage) I'm able to identity DBU usage per query, but I'm not able to identify who ran each query because is not part of the table.
I'm also aware of query history where all the queries and who ran them is listed.
I was thinking if it might possible to combine both to get DBU usage per user, of if you know any other way to achieve same result.
I'll greatly appreciate it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 05:30 AM - edited 12-21-2023 05:49 AM
thanks @Retired_mod for the reply, however query_id is not part of the system.billing.usage table, so no way to join them by IDs. What my Databricks account team suggested me is to join them by timestamps since both tables contain a column like that.
Also, I had to request the enablement of the Query History system table as it is still in private preview as of now.
BTW - I'm user of Azure Databricks, and if you look at AWS or GCP ones that might be the reason why you see different columns in system tables. could be the reason?.