Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pentium10/b769e3da2b5909b88740f2226ee43a6e to your computer and use it in GitHub Desktop.
Save pentium10/b769e3da2b5909b88740f2226ee43a6e to your computer and use it in GitHub Desktop.
DECLARE var_day STRING DEFAULT '2022-10-03';
SELECT creation_time,
round(5* (total_bytes_processed/POWER(2,40) ),2) AS processedBytesCostProjection,
round(5* (total_bytes_billed/POWER(2,40) ),2) AS billedBytesCostInUSD
from `prj_id.region-us`.INFORMATION_SCHEMA.JOBS_BY_PROJECT
where creation_time BETWEEN timestamp(var_day) and TIMESTAMP_add(timestamp(var_day), INTERVAL 1 DAY)
and job_type = "QUERY"
ORDER BY processedBytesCostProjection desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment