GoogleCloudPlatform / bigquery-utils

Useful scripts, udfs, views, and other utilities for migration and data warehouse operations in BigQuery.
https://cloud.google.com/bigquery/
Apache License 2.0
1.13k stars 283 forks source link

Update job_execution.sql #451

Closed franklinWhaite closed 2 months ago

franklinWhaite commented 2 months ago

Changed the calculation of job_duration_seconds in the job_execution.sql

If the job is running then end_time is null. Therefore an admin cannot easily visualize for how long the a job has been running until it is done.

With this change, if the job is not done then job_duration_seconds is calculates as the difference between start time and current time. Thus and admin can know easily identify the duration of a RUNNING / PENDING job and identify long running / troublesome jobs.