Skip to content

Instantly share code, notes, and snippets.

@thomashandorf
Last active October 31, 2023 09:26
Show Gist options
  • Save thomashandorf/2e0104730f27b7258c4b7b88a20b0a74 to your computer and use it in GitHub Desktop.
Save thomashandorf/2e0104730f27b7258c4b7b88a20b0a74 to your computer and use it in GitHub Desktop.
BigQuery billed byte by user
SELECT
user_email,
SUM(total_bytes_billed) AS bytes_billed_last_month
FROM
`region-europe-west1`.INFORMATION_SCHEMA.JOBS_BY_PROJECT
WHERE
EXTRACT(MONTH FROM creation_time) = EXTRACT(MONTH FROM CURRENT_DATE()) - 1
GROUP BY
user_email
ORDER BY
bytes_billed_last_month DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment