Tools
Athena
Run SQL queries on data in Amazon S3 using AWS Athena
Integrate AWS Athena into workflows. Execute SQL queries against data in S3, check query status, retrieve results, manage named queries, and list executions. Requires AWS access key and secret access key.
Start an SQL query execution in AWS Athena
| Parameter | Type | Required | Description |
|---|
awsRegion | string | Yes | AWS region (e.g., us-east-1) |
awsAccessKeyId | string | Yes | AWS access key ID |
awsSecretAccessKey | string | Yes | AWS secret access key |
queryString | string | Yes | SQL query string to execute |
database | string | No | Database name within the catalog |
catalog | string | No | Data catalog name (default: AwsDataCatalog) |
outputLocation | string | No | S3 output location for query results (e.g., s3://bucket/path/) |
workGroup | string | No | Workgroup to execute the query in (default: primary) |
| Parameter | Type | Description |
|---|
queryExecutionId | string | Unique ID of the started query execution |
Get the status and details of an Athena query execution
| Parameter | Type | Required | Description |
|---|
awsRegion | string | Yes | AWS region (e.g., us-east-1) |
awsAccessKeyId | string | Yes | AWS access key ID |
awsSecretAccessKey | string | Yes | AWS secret access key |
queryExecutionId | string | Yes | Query execution ID to check |
| Parameter | Type | Description |
|---|
queryExecutionId | string | Query execution ID |
query | string | SQL query string |
state | string | Query state (QUEUED, RUNNING, SUCCEEDED, FAILED, CANCELLED) |
stateChangeReason | string | Reason for state change (e.g., error message) |
statementType | string | Statement type (DDL, DML, UTILITY) |
database | string | Database name |
catalog | string | Data catalog name |
workGroup | string | Workgroup name |
submissionDateTime | number | Query submission time (Unix epoch ms) |
completionDateTime | number | Query completion time (Unix epoch ms) |
dataScannedInBytes | number | Amount of data scanned in bytes |
engineExecutionTimeInMillis | number | Engine execution time in milliseconds |
queryPlanningTimeInMillis | number | Query planning time in milliseconds |
queryQueueTimeInMillis | number | Time the query spent in queue in milliseconds |
totalExecutionTimeInMillis | number | Total execution time in milliseconds |
outputLocation | string | S3 location of query results |
Retrieve the results of a completed Athena query execution
| Parameter | Type | Required | Description |
|---|
awsRegion | string | Yes | AWS region (e.g., us-east-1) |
awsAccessKeyId | string | Yes | AWS access key ID |
awsSecretAccessKey | string | Yes | AWS secret access key |
queryExecutionId | string | Yes | Query execution ID to get results for |
maxResults | number | No | Maximum number of rows to return (1-999) |
nextToken | string | No | Pagination token from a previous request |
| Parameter | Type | Description |
|---|
columns | array | Column metadata (name and type) |
rows | array | Result rows as key-value objects |
nextToken | string | Pagination token for next page of results |
updateCount | number | Number of rows affected (for INSERT/UPDATE statements) |
Stop a running Athena query execution
| Parameter | Type | Required | Description |
|---|
awsRegion | string | Yes | AWS region (e.g., us-east-1) |
awsAccessKeyId | string | Yes | AWS access key ID |
awsSecretAccessKey | string | Yes | AWS secret access key |
queryExecutionId | string | Yes | Query execution ID to stop |
| Parameter | Type | Description |
|---|
success | boolean | Whether the query was successfully stopped |
List recent Athena query execution IDs
| Parameter | Type | Required | Description |
|---|
awsRegion | string | Yes | AWS region (e.g., us-east-1) |
awsAccessKeyId | string | Yes | AWS access key ID |
awsSecretAccessKey | string | Yes | AWS secret access key |
workGroup | string | No | Workgroup to list executions for (default: primary) |
maxResults | number | No | Maximum number of results (0-50) |
nextToken | string | No | Pagination token from a previous request |
| Parameter | Type | Description |
|---|
queryExecutionIds | array | List of query execution IDs |
nextToken | string | Pagination token for next page |
Get the status and details of up to 50 Athena query executions in one call
| Parameter | Type | Required | Description |
|---|
awsRegion | string | Yes | AWS region (e.g., us-east-1) |
awsAccessKeyId | string | Yes | AWS access key ID |
awsSecretAccessKey | string | Yes | AWS secret access key |
queryExecutionIds | string | Yes | Comma-separated query execution IDs to check (up to 50) |
| Parameter | Type | Description |
|---|
queryExecutions | array | Details for each successfully retrieved query execution |
unprocessedQueryExecutionIds | array | Query execution IDs that could not be retrieved, with error details |
Create a saved/named query in AWS Athena
| Parameter | Type | Required | Description |
|---|
awsRegion | string | Yes | AWS region (e.g., us-east-1) |
awsAccessKeyId | string | Yes | AWS access key ID |
awsSecretAccessKey | string | Yes | AWS secret access key |
name | string | Yes | Name for the saved query |
database | string | Yes | Database the query runs against |
queryString | string | Yes | SQL query string to save |
description | string | No | Description of the named query |
workGroup | string | No | Workgroup to create the named query in |
| Parameter | Type | Description |
|---|
namedQueryId | string | ID of the created named query |
Get details of a saved/named query in AWS Athena
| Parameter | Type | Required | Description |
|---|
awsRegion | string | Yes | AWS region (e.g., us-east-1) |
awsAccessKeyId | string | Yes | AWS access key ID |
awsSecretAccessKey | string | Yes | AWS secret access key |
namedQueryId | string | Yes | Named query ID to retrieve |
| Parameter | Type | Description |
|---|
namedQueryId | string | Named query ID |
name | string | Name of the saved query |
description | string | Query description |
database | string | Database the query runs against |
queryString | string | SQL query string |
workGroup | string | Workgroup name |
List saved/named query IDs in AWS Athena
| Parameter | Type | Required | Description |
|---|
awsRegion | string | Yes | AWS region (e.g., us-east-1) |
awsAccessKeyId | string | Yes | AWS access key ID |
awsSecretAccessKey | string | Yes | AWS secret access key |
workGroup | string | No | Workgroup to list named queries for |
maxResults | number | No | Maximum number of results (0-50) |
nextToken | string | No | Pagination token from a previous request |
| Parameter | Type | Description |
|---|
namedQueryIds | array | List of named query IDs |
nextToken | string | Pagination token for next page |
Delete a saved/named query in AWS Athena
| Parameter | Type | Required | Description |
|---|
awsRegion | string | Yes | AWS region (e.g., us-east-1) |
awsAccessKeyId | string | Yes | AWS access key ID |
awsSecretAccessKey | string | Yes | AWS secret access key |
namedQueryId | string | Yes | Named query ID to delete |
| Parameter | Type | Description |
|---|
success | boolean | Whether the named query was successfully deleted |
List the databases available in an Athena data catalog
| Parameter | Type | Required | Description |
|---|
awsRegion | string | Yes | AWS region (e.g., us-east-1) |
awsAccessKeyId | string | Yes | AWS access key ID |
awsSecretAccessKey | string | Yes | AWS secret access key |
catalogName | string | Yes | Data catalog name to list databases from (e.g., AwsDataCatalog) |
workGroup | string | No | Workgroup for which the metadata is being fetched (required for IAM Identity Center enabled catalogs) |
maxResults | number | No | Maximum number of results (1-50) |
nextToken | string | No | Pagination token from a previous request |
| Parameter | Type | Description |
|---|
databases | array | List of databases (name, description) |
nextToken | string | Pagination token for next page |
List tables and their column/partition metadata for an Athena database
| Parameter | Type | Required | Description |
|---|
awsRegion | string | Yes | AWS region (e.g., us-east-1) |
awsAccessKeyId | string | Yes | AWS access key ID |
awsSecretAccessKey | string | Yes | AWS secret access key |
catalogName | string | Yes | Data catalog name (e.g., AwsDataCatalog) |
databaseName | string | Yes | Database name to list tables from |
expression | string | No | Regex filter that pattern-matches table names |
workGroup | string | No | Workgroup for which the metadata is being fetched (required for IAM Identity Center enabled catalogs) |
maxResults | number | No | Maximum number of results (1-50) |
nextToken | string | No | Pagination token from a previous request |
| Parameter | Type | Description |
|---|
tables | array | Table metadata (name, type, columns, partition keys) |
nextToken | string | Pagination token for next page |
- Category:
tools
- Type:
athena