sessions
The sessions system table contains one row for each AWS Glue interactive session
in your account and Region, for sessions running AWS Glue version 6.1 or later.
AWS Glue writes a row when a session reaches a terminal state. AWS Glue does not write data while a session 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 sessions table:
SELECT * FROM "s3tablescatalog/aws-glue"."metadata"."sessions" LIMIT 10
Columns
The following table describes the columns in the sessions system
table.
Column |
Type |
Description |
|---|---|---|
|
string |
The identifier that AWS Glue assigned to this interactive session. |
|
string |
The AWS account that owns the session. |
|
string |
The AWS Region where the session ran. |
|
string |
The platform that ran the session. Always
|
|
string |
The kind of session. Valid values are |
|
string |
The processing engine that ran the session. Valid values are
|
|
string |
The AWS Glue version the session used, for example
|
|
long |
How long the session can stay idle before AWS Glue stops it, in minutes. |
|
string |
The session's default arguments as JSON, with secrets redacted. |
|
int |
The number of workers allocated to the session. Null for capacity-based sessions. |
|
string |
The worker type the session used, for example
|
|
double |
The Data Processing Unit (DPU)-seconds the session consumed over its lifetime. |
|
string |
The Amazon Resource Name (ARN) of the IAM principal that called
|
|
string |
The ARN of the IAM role the session used. |
|
string |
The identifier of the end user the session 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 session's final state, as AWS Glue reports it in the console and API. |
|
string |
The error message for a session that failed. Null otherwise. |
|
timestamp with time zone |
When the session started. |
|
timestamp with time zone |
When the session 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 sessions table.
Sessions by type and final state in the past 7 days
The following SQL query shows sessions by type and final state in the past 7 days:
SELECT session_type_enum, final_state_enum, COUNT(*) AS sessions, SUM(dpu_seconds) / 3600.0 AS dpu_hours FROM "s3tablescatalog/aws-glue"."metadata"."sessions" WHERE end_time >= CURRENT_TIMESTAMP - INTERVAL '7' DAY GROUP BY session_type_enum, final_state_enum
Who uses the most session DPU
The following SQL query shows who uses the most session DPU-seconds in the past 30 days:
SELECT submitter_arn, COUNT(*) AS sessions, SUM(dpu_seconds) / 3600.0 AS dpu_hours FROM "s3tablescatalog/aws-glue"."metadata"."sessions" WHERE end_time >= CURRENT_TIMESTAMP - INTERVAL '30' DAY GROUP BY submitter_arn ORDER BY dpu_hours DESC
Sessions that timed out, and their idle timeout
The following SQL query shows sessions that timed out and their idle timeout in the past 7 days:
SELECT session_id, submitter_arn, idle_timeout_minutes, start_time, end_time FROM "s3tablescatalog/aws-glue"."metadata"."sessions" WHERE end_time >= CURRENT_TIMESTAMP - INTERVAL '7' DAY AND final_state_enum = 'TIMEOUT'