Athena

Amazon Athena is an interactive query service from AWS that makes it easy to analyze data directly in Amazon S3 using standard SQL. Athena is serverless, so there is no infrastructure to manage, and you pay only for the queries you run.

With Athena, you can:

  • Query data in S3: Run SQL queries directly against data stored in Amazon S3 without loading it into a database
  • Support multiple formats: Query CSV, JSON, Parquet, ORC, Avro, and other common data formats
  • Integrate with AWS Glue: Use the AWS Glue Data Catalog to manage table metadata and schemas
  • Scale automatically: Handle queries of any size without provisioning servers or clusters
  • Save and reuse queries: Create named queries for frequently used SQL statements

In Sim, the Athena integration enables your agents to run SQL queries against data in S3, check query execution status, retrieve results, and manage saved queries — all within your agent workflows. Supported operations include:

  • Start Query: Execute SQL queries against your S3 data
  • Get Query Execution: Check the status and details of a running or completed query
  • Get Query Results: Retrieve the results of a completed query
  • Stop Query: Cancel a running query execution
  • List Query Executions: View recent query execution IDs
  • Create Named Query: Save a query for reuse
  • Get Named Query: Retrieve details of a saved query
  • List Named Queries: View all saved query IDs

This integration empowers Sim agents to automate data analysis tasks using AWS Athena, enabling workflows that query, monitor, and manage large-scale data in S3 without manual effort or infrastructure management.

Usage Instructions

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.

Actions

athena_start_query

Start an SQL query execution in AWS Athena

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
queryStringstringYesSQL query string to execute
databasestringNoDatabase name within the catalog
catalogstringNoData catalog name (default: AwsDataCatalog)
outputLocationstringNoS3 output location for query results (e.g., s3://bucket/path/)
workGroupstringNoWorkgroup to execute the query in (default: primary)

Output

ParameterTypeDescription
queryExecutionIdstringUnique ID of the started query execution

athena_get_query_execution

Get the status and details of an Athena query execution

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
queryExecutionIdstringYesQuery execution ID to check

Output

ParameterTypeDescription
queryExecutionIdstringQuery execution ID
querystringSQL query string
statestringQuery state (QUEUED, RUNNING, SUCCEEDED, FAILED, CANCELLED)
stateChangeReasonstringReason for state change (e.g., error message)
statementTypestringStatement type (DDL, DML, UTILITY)
databasestringDatabase name
catalogstringData catalog name
workGroupstringWorkgroup name
submissionDateTimenumberQuery submission time (Unix epoch ms)
completionDateTimenumberQuery completion time (Unix epoch ms)
dataScannedInBytesnumberAmount of data scanned in bytes
engineExecutionTimeInMillisnumberEngine execution time in milliseconds
queryPlanningTimeInMillisnumberQuery planning time in milliseconds
queryQueueTimeInMillisnumberTime the query spent in queue in milliseconds
totalExecutionTimeInMillisnumberTotal execution time in milliseconds
outputLocationstringS3 location of query results

athena_get_query_results

Retrieve the results of a completed Athena query execution

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
queryExecutionIdstringYesQuery execution ID to get results for
maxResultsnumberNoMaximum number of rows to return (1-999)
nextTokenstringNoPagination token from a previous request

Output

ParameterTypeDescription
columnsarrayColumn metadata (name and type)
rowsarrayResult rows as key-value objects
nextTokenstringPagination token for next page of results
updateCountnumberNumber of rows affected (for INSERT/UPDATE statements)

athena_stop_query

Stop a running Athena query execution

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
queryExecutionIdstringYesQuery execution ID to stop

Output

ParameterTypeDescription
successbooleanWhether the query was successfully stopped

athena_list_query_executions

List recent Athena query execution IDs

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
workGroupstringNoWorkgroup to list executions for (default: primary)
maxResultsnumberNoMaximum number of results (0-50)
nextTokenstringNoPagination token from a previous request

Output

ParameterTypeDescription
queryExecutionIdsarrayList of query execution IDs
nextTokenstringPagination token for next page

athena_batch_get_query_execution

Get the status and details of up to 50 Athena query executions in one call

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
queryExecutionIdsstringYesComma-separated query execution IDs to check (up to 50)

Output

ParameterTypeDescription
queryExecutionsarrayDetails for each successfully retrieved query execution
queryExecutionIdstringQuery execution ID
querystringSQL query string
statestringQuery state (QUEUED, RUNNING, SUCCEEDED, FAILED, CANCELLED)
stateChangeReasonstringReason for state change
statementTypestringStatement type (DDL, DML, UTILITY)
databasestringDatabase name
catalogstringData catalog name
workGroupstringWorkgroup name
submissionDateTimenumberQuery submission time (Unix epoch ms)
completionDateTimenumberQuery completion time (Unix epoch ms)
dataScannedInBytesnumberAmount of data scanned in bytes
engineExecutionTimeInMillisnumberEngine execution time in milliseconds
queryPlanningTimeInMillisnumberQuery planning time in milliseconds
queryQueueTimeInMillisnumberTime the query spent in queue in milliseconds
totalExecutionTimeInMillisnumberTotal execution time in milliseconds
outputLocationstringS3 location of query results
unprocessedQueryExecutionIdsarrayQuery execution IDs that could not be retrieved, with error details
queryExecutionIdstringQuery execution ID
errorCodestringError code
errorMessagestringError message

athena_create_named_query

Create a saved/named query in AWS Athena

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
namestringYesName for the saved query
databasestringYesDatabase the query runs against
queryStringstringYesSQL query string to save
descriptionstringNoDescription of the named query
workGroupstringNoWorkgroup to create the named query in

Output

ParameterTypeDescription
namedQueryIdstringID of the created named query

athena_get_named_query

Get details of a saved/named query in AWS Athena

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
namedQueryIdstringYesNamed query ID to retrieve

Output

ParameterTypeDescription
namedQueryIdstringNamed query ID
namestringName of the saved query
descriptionstringQuery description
databasestringDatabase the query runs against
queryStringstringSQL query string
workGroupstringWorkgroup name

athena_list_named_queries

List saved/named query IDs in AWS Athena

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
workGroupstringNoWorkgroup to list named queries for
maxResultsnumberNoMaximum number of results (0-50)
nextTokenstringNoPagination token from a previous request

Output

ParameterTypeDescription
namedQueryIdsarrayList of named query IDs
nextTokenstringPagination token for next page

athena_delete_named_query

Delete a saved/named query in AWS Athena

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
namedQueryIdstringYesNamed query ID to delete

Output

ParameterTypeDescription
successbooleanWhether the named query was successfully deleted

athena_list_databases

List the databases available in an Athena data catalog

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
catalogNamestringYesData catalog name to list databases from (e.g., AwsDataCatalog)
workGroupstringNoWorkgroup for which the metadata is being fetched (required for IAM Identity Center enabled catalogs)
maxResultsnumberNoMaximum number of results (1-50)
nextTokenstringNoPagination token from a previous request

Output

ParameterTypeDescription
databasesarrayList of databases (name, description)
namestringDatabase name
descriptionstringDatabase description
nextTokenstringPagination token for next page

athena_list_table_metadata

List tables and their column/partition metadata for an Athena database

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
catalogNamestringYesData catalog name (e.g., AwsDataCatalog)
databaseNamestringYesDatabase name to list tables from
expressionstringNoRegex filter that pattern-matches table names
workGroupstringNoWorkgroup for which the metadata is being fetched (required for IAM Identity Center enabled catalogs)
maxResultsnumberNoMaximum number of results (1-50)
nextTokenstringNoPagination token from a previous request

Output

ParameterTypeDescription
tablesarrayTable metadata (name, type, columns, partition keys)
namestringTable name
tableTypestringTable type
createTimenumberTable creation time (Unix epoch ms)
lastAccessTimenumberTable last access time (Unix epoch ms)
columnsarrayColumn definitions
namestringColumn name
typestringColumn data type
commentstringColumn comment
partitionKeysarrayPartition key definitions
namestringPartition key name
typestringPartition key data type
commentstringPartition key comment
nextTokenstringPagination token for next page

On this page