query_executions
Creates, updates, deletes, gets or lists a query_executions resource.
Overview
| Name | query_executions |
| Type | Resource |
| Id | aws.athena.query_executions |
Fields
The following fields are returned by SELECT queries:
- batch_get_query_execution
- get_query_execution
- list_query_executions
| Name | Datatype | Description |
|---|---|---|
query_executions | array | Information about a query execution. |
unprocessed_query_execution_ids | array | Information about the query executions that failed to run. |
| Name | Datatype | Description |
|---|---|---|
engine_version | object | The engine version that executed the query. |
execution_parameters | array | A list of values for the parameters in a query. The values are applied sequentially to the parameters in the query in the order in which the parameters occur. The list of parameters is not returned in the response. |
managed_query_results_configuration | object | The configuration for storing results in Athena owned storage, which includes whether this feature is enabled; whether encryption configuration, if any, is used for encrypting query results. |
query | string | The SQL query statements which the query execution ran. |
query_execution_context | object | The database in which the query execution occurred. |
query_execution_id | string | The unique identifier for each query execution. (pattern: <code>\S+</code>) |
query_results_s3_access_grants_configuration | object | Specifies whether Amazon S3 access grants are enabled for query results. |
result_configuration | object | The location in Amazon S3 where query and calculation results are stored and the encryption option, if any, used for query results. These are known as "client-side settings". If workgroup settings override client-side settings, then the query uses the location for the query results and the encryption configuration that are specified for the workgroup. |
result_reuse_configuration | object | Specifies the query result reuse behavior that was used for the query. |
statement_type | 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, EXPLAIN, DESCRIBE, or SHOW TABLES. (DDL, DML, UTILITY) |
statistics | object | Query execution statistics, such as the amount of data scanned, the amount of time that the query took to process, and the type of statement that was run. |
status | object | The completion date, current state, submission time, and state change reason (if applicable) for the query execution. |
substatement_type | string | The kind of query statement that was run. |
work_group | string | The name of the workgroup in which the query ran. (pattern: <code>[a-zA-Z0-9._-]{1,128}</code>) |
| Name | Datatype | Description |
|---|---|---|
query_execution_id | string | The unique IDs of each query execution as an array of strings. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
batch_get_query_execution | select | region | Returns the details of a single query execution or a list of up to 50 query executions, which you provide as an array of query execution ID strings. Requires you to have access to the workgroup in which the queries ran. To get a list of query execution IDs, use ListQueryExecutionsInput$WorkGroup. Query executions differ from named (saved) queries. Use BatchGetNamedQueryInput to get details about named queries. | |
get_query_execution | select | region | Returns information about a single execution of a query if you have access to the workgroup in which the query ran. Each time a query executes, information about the query execution is saved with a unique ID. | |
list_query_executions | select | region | Provides a list of available query execution IDs for the queries in the specified workgroup. Athena keeps a query history for 45 days. If a workgroup is not specified, returns a list of query execution IDs for the primary workgroup. Requires you to have access to the workgroup in which the queries ran. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- batch_get_query_execution
- get_query_execution
- list_query_executions
Returns the details of a single query execution or a list of up to 50 query executions, which you provide as an array of query execution ID strings. Requires you to have access to the workgroup in which the queries ran. To get a list of query execution IDs, use ListQueryExecutionsInput$WorkGroup. Query executions differ from named (saved) queries. Use BatchGetNamedQueryInput to get details about named queries.
SELECT
query_executions,
unprocessed_query_execution_ids
FROM aws.athena.query_executions
WHERE region = '{{ region }}' -- required
;
Returns information about a single execution of a query if you have access to the workgroup in which the query ran. Each time a query executes, information about the query execution is saved with a unique ID.
SELECT
engine_version,
execution_parameters,
managed_query_results_configuration,
query,
query_execution_context,
query_execution_id,
query_results_s3_access_grants_configuration,
result_configuration,
result_reuse_configuration,
statement_type,
statistics,
status,
substatement_type,
work_group
FROM aws.athena.query_executions
WHERE region = '{{ region }}' -- required
;
Provides a list of available query execution IDs for the queries in the specified workgroup. Athena keeps a query history for 45 days. If a workgroup is not specified, returns a list of query execution IDs for the primary workgroup. Requires you to have access to the workgroup in which the queries ran.
SELECT
query_execution_id
FROM aws.athena.query_executions
WHERE region = '{{ region }}' -- required
;