Skip to content

aws.athena.get_session

Example SQL Queries

SELECT * FROM
aws.athena.get_session
WHERE
"session_id" = 'VALUE';

Description

Gets the full details of a previously created session, including the session status and configuration.

Table Definition

Column NameColumn Data Type
session_id Required Input Column

The session ID.

VARCHAR
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

_aws_region Input Column

The AWS region to use.

VARCHAR
description

The session description.

VARCHAR
engine_configuration

Contains engine configuration information like DPU usage.

STRUCT(
"coordinator_dpu_size" BIGINT,
"max_concurrent_dpus" BIGINT,
"default_executor_dpu_size" BIGINT,
"additional_configs" MAP(VARCHAR, VARCHAR),
"spark_properties" MAP(VARCHAR, VARCHAR)
)
Show child fields
engine_configuration.additional_configs

Contains additional notebook engine MAP<string, string> parameter mappings in the form of key-value pairs. To specify an Athena notebook that the Jupyter server will download and serve, specify a value for the StartSessionRequest$NotebookVersion field, and then add a key named NotebookId to AdditionalConfigs that has the value of the Athena notebook ID.

engine_configuration.coordinator_dpu_size

The number of DPUs to use for the coordinator. A coordinator is a special executor that orchestrates processing work and manages other executors in a notebook session. The default is 1.

engine_configuration.default_executor_dpu_size

The default number of DPUs to use for executors. An executor is the smallest unit of compute that a notebook session can request from Athena. The default is 1.

engine_configuration.max_concurrent_dpus

The maximum number of DPUs that can run concurrently.

engine_configuration.spark_properties

Specifies custom jar files and Spark properties for use cases like cluster encryption, table formats, and general Spark tuning.

engine_version

The engine version used by the session (for example, PySpark engine version 3). You can get a list of engine versions by calling ListEngineVersions.

VARCHAR
notebook_version

The notebook version.

VARCHAR
session_configuration

Contains the workgroup configuration information used by the session.

STRUCT(
"execution_role" VARCHAR,
"working_directory" VARCHAR,
"idle_timeout_seconds" BIGINT,
"encryption_configuration" STRUCT(
"encryption_option" VARCHAR,
"kms_key" VARCHAR
)
)
Show child fields
session_configuration.encryption_configuration

If query and calculation results are encrypted in Amazon S3, indicates the encryption option used (for example, SSE_KMS or CSE_KMS) and key information.

Show child fields
session_configuration.encryption_configuration.encryption_option

Indicates whether Amazon S3 server-side encryption with Amazon S3-managed keys (SSE_S3), server-side encryption with KMS-managed keys (SSE_KMS), or client-side encryption with KMS-managed keys (CSE_KMS) is used.

If a query runs in a workgroup and the workgroup overrides client-side settings, then the workgroup's setting for encryption is used. It specifies whether query results must be encrypted, for all queries that run in this workgroup.

session_configuration.encryption_configuration.kms_key

For SSE_KMS and CSE_KMS, this is the KMS key ARN or ID.

session_configuration.execution_role

The ARN of the execution role used to access user resources for Spark sessions and Identity Center enabled workgroups. This property applies only to Spark enabled workgroups and Identity Center enabled workgroups.

session_configuration.idle_timeout_seconds

The idle timeout in seconds for the session.

session_configuration.working_directory

The Amazon S3 location that stores information for the notebook.

statistics

Contains the DPU execution time.

STRUCT(
"dpu_execution_in_millis" BIGINT
)
Show child fields
statistics.dpu_execution_in_millis

The data processing unit execution time for a session in milliseconds.

status

Contains information about the status of the session.

STRUCT(
"start_date_time" TIMESTAMP_S,
"last_modified_date_time" TIMESTAMP_S,
"end_date_time" TIMESTAMP_S,
"idle_since_date_time" TIMESTAMP_S,
"state" VARCHAR,
"state_change_reason" VARCHAR
)
Show child fields
status.end_date_time

The date and time that the session ended.

status.idle_since_date_time

The date and time starting at which the session became idle. Can be empty if the session is not currently idle.

status.last_modified_date_time

The most recent date and time that the session was modified.

status.start_date_time

The date and time that the session started.

status.state

The state of the session. A description of each state follows.

CREATING - The session is being started, including acquiring resources.

CREATED - The session has been started.

IDLE - The session is able to accept a calculation.

BUSY - The session is processing another task and is unable to accept a calculation.

TERMINATING - The session is in the process of shutting down.

TERMINATED - The session and its resources are no longer running.

DEGRADED - The session has no healthy coordinators.

FAILED - Due to a failure, the session and its resources are no longer running.

status.state_change_reason

The reason for the session state change (for example, canceled because the session was terminated).

work_group

The workgroup to which the session belongs.

VARCHAR