Table Of Contents


User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . athena ]



Returns information about a single execution of a query. Each time a query executes, information about the query execution is saved with a unique ID.

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.


--query-execution-id <value>
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]


--query-execution-id (string)

The unique ID of the query execution.

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.


QueryExecution -> (structure)

Information about the query execution.

QueryExecutionId -> (string)

The unique identifier for each query execution.

Query -> (string)

The SQL query statements which the query execution ran.

StatementType -> (string)

The type of query statement that was run. DDL indicates DDL query statements. DML indicates DML (Data Manipulation Language) query statements, such as CREATE TABLE AS SELECT . UTILITY indicates query statements other than DDL and DML, such as SHOW CREATE TABLE , or DESCRIBE table .

ResultConfiguration -> (structure)

The location in Amazon S3 where query results were stored and the encryption option, if any, used for query results.

OutputLocation -> (string)

The location in Amazon S3 where your query results are stored, such as s3://path/to/query/bucket/ . For more information, see Queries and Query Result Files.

EncryptionConfiguration -> (structure)

If query results are encrypted in Amazon S3, indicates the encryption option used (for example, SSE-KMS or CSE-KMS ) and key information.

EncryptionOption -> (string)

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.

KmsKey -> (string)

For SSE-KMS and CSE-KMS , this is the KMS key ARN or ID.

QueryExecutionContext -> (structure)

The database in which the query execution occurred.

Database -> (string)

The name of the database.

Status -> (structure)

The completion date, current state, submission time, and state change reason (if applicable) for the query execution.

State -> (string)

The state of query execution. QUEUED state is listed but is not used by Athena and is reserved for future use. RUNNING indicates that the query has been submitted to the service, and Athena will execute the query as soon as resources are available. SUCCEEDED indicates that the query completed without error. FAILED indicates that the query experienced an error and did not complete processing.``CANCELLED`` indicates that user input interrupted query execution.

StateChangeReason -> (string)

Further detail about the status of the query.

SubmissionDateTime -> (timestamp)

The date and time that the query was submitted.

CompletionDateTime -> (timestamp)

The date and time that the query completed.

Statistics -> (structure)

The amount of data scanned during the query execution and the amount of time that it took to execute, and the type of statement that was run.

EngineExecutionTimeInMillis -> (long)

The number of milliseconds that the query took to execute.

DataScannedInBytes -> (long)

The number of bytes in the data that was queried.