job_runs
The job_runs system table contains one row for each AWS Glue job run in your
account and Region, for jobs running AWS Glue version 6.1 or later.
AWS Glue writes a row when a job run reaches a terminal state. AWS Glue does not write data while a job run is in progress.
Table location
You query system tables like any other Amazon S3 Tables. The following SQL query
returns 10 sample rows from the job_runs table:
SELECT * FROM "s3tablescatalog/aws-glue"."metadata"."job_runs" LIMIT 10
Columns
The following table describes the columns in the job_runs system
table.
Column |
Type |
Description |
|---|---|---|
|
string |
The name of the AWS Glue job. |
|
string |
The identifier that AWS Glue assigned to this job run (the job run ID). |
|
int |
The retry attempt number of this run. |
|
string |
The AWS account that owns the job run. |
|
string |
The AWS Region where the job run ran. |
|
string |
The platform that ran the job run. Always
|
|
string |
The Amazon Resource Name (ARN) of the AWS Glue job. |
|
string |
How the job was authored. Valid values are |
|
string |
The processing engine that ran the job run. Valid values are
|
|
string |
The AWS Glue version the run used, for example
|
|
string |
The kind of AWS Glue job. Valid values are |
|
string |
The run's effective arguments as JSON, with secrets redacted. |
|
int |
The number of workers allocated to the run. Null for capacity-based runs. |
|
string |
The worker type the run used, for example
|
|
string |
The execution class the run used. Valid values are
|
|
double |
The Data Processing Unit (DPU)-seconds the run consumed. Null when AWS Glue does not report it for the run's version or mode. |
|
string |
The ARN of the IAM principal that called
|
|
string |
The ARN of the IAM role the run used. |
|
string |
The identifier of the end user the run acted for under trusted identity propagation, as propagated by the identity provider (for example, an email address). Null when trusted identity propagation is off. |
|
string |
The identity provider that issued the end user's identity. Null when not propagated. |
|
string |
The run's final state, as AWS Glue reports it in the console and API. |
|
string |
The error message for a run that did not succeed. Null otherwise. |
|
timestamp with time zone |
When the run started. |
|
timestamp with time zone |
When the run reached its final state. This is a partition column (by day). |
|
string |
The version identifier for this row's field set. |
|
timestamp with time zone |
When this row was written to the table. |
Example queries
The following examples show common queries against the job_runs table.
Failed job runs in the past 24 hours
The following SQL query shows failed job runs in the past 24 hours:
SELECT job_name, execution_id, final_state_enum, error_message, completion_time FROM "s3tablescatalog/aws-glue"."metadata"."job_runs" WHERE completion_time >= CURRENT_TIMESTAMP - INTERVAL '1' DAY AND final_state_enum IN ('FAILED', 'TIMEOUT', 'ERROR') ORDER BY completion_time DESC
Top 10 jobs by DPU-seconds in the past 30 days
The following SQL query shows the top 10 jobs by DPU-seconds in the past 30 days:
SELECT job_name, COUNT(*) AS runs, SUM(dpu_seconds) / 3600.0 AS dpu_hours FROM "s3tablescatalog/aws-glue"."metadata"."job_runs" WHERE completion_time >= CURRENT_TIMESTAMP - INTERVAL '30' DAY GROUP BY job_name ORDER BY dpu_hours DESC LIMIT 10
Job runs for one team by name prefix
The following SQL query shows job runs for one team by job name prefix in the
past 7 days. Replace finance- with your team's job name prefix:
SELECT job_name, final_state_enum, COUNT(*) AS runs FROM "s3tablescatalog/aws-glue"."metadata"."job_runs" WHERE completion_time >= CURRENT_TIMESTAMP - INTERVAL '7' DAY AND job_name LIKE 'finance-%' GROUP BY job_name, final_state_enum
Who started job runs, and on which role
The following SQL query shows who started job runs and which role they used in the past 30 days:
SELECT submitter_arn, execution_role_arn, COUNT(*) AS runs, SUM(dpu_seconds) AS dpu_seconds FROM "s3tablescatalog/aws-glue"."metadata"."job_runs" WHERE completion_time >= CURRENT_TIMESTAMP - INTERVAL '30' DAY GROUP BY submitter_arn, execution_role_arn ORDER BY dpu_seconds DESC