Skip to content

Instantly share code, notes, and snippets.

@masutaka
Last active November 26, 2021 07:00
Show Gist options
  • Save masutaka/afe46888da499ea9d7ff6d07fbbe7703 to your computer and use it in GitHub Desktop.
Save masutaka/afe46888da499ea9d7ff6d07fbbe7703 to your computer and use it in GitHub Desktop.
The ranking of BigQuery total_bytes_billed on 11/18
select
job_type
, user_email
, referenced_tables.dataset_id
, round(sum(total_bytes_billed) / pow(10, 9), 2) AS total_gb_billed
from
`region-us.INFORMATION_SCHEMA.JOBS_BY_PROJECT`
, UNNEST(referenced_tables) AS referenced_tables
WHERE CAST(creation_time AS DATE) = DATE('2021-11-18')
group by job_type, user_email, referenced_tables.dataset_id
order by total_gb_billed desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment