Skip to content

Athena

CloudMock emulates Amazon Athena, supporting workgroup management, named queries, and query execution lifecycle operations.

OperationStatusNotes
CreateWorkGroupSupportedCreates a workgroup
GetWorkGroupSupportedReturns workgroup details
ListWorkGroupsSupportedLists all workgroups
UpdateWorkGroupSupportedUpdates workgroup configuration
DeleteWorkGroupSupportedDeletes a workgroup
CreateNamedQuerySupportedSaves a named query
GetNamedQuerySupportedReturns a named query
ListNamedQueriesSupportedLists named query IDs
DeleteNamedQuerySupportedDeletes a named query
StartQueryExecutionSupportedStarts a query execution
GetQueryExecutionSupportedReturns query execution status
ListQueryExecutionsSupportedLists query execution IDs
StopQueryExecutionSupportedCancels a running query
GetQueryResultsSupportedReturns stub query results
TagResourceSupportedAdds tags to a resource
UntagResourceSupportedRemoves tags from a resource
import { AthenaClient, StartQueryExecutionCommand, GetQueryExecutionCommand } from '@aws-sdk/client-athena';
const client = new AthenaClient({
endpoint: 'http://localhost:4566',
region: 'us-east-1',
credentials: { accessKeyId: 'test', secretAccessKey: 'test' },
});
const { QueryExecutionId } = await client.send(new StartQueryExecutionCommand({
QueryString: 'SELECT * FROM my_table',
WorkGroup: 'primary',
}));
const result = await client.send(new GetQueryExecutionCommand({ QueryExecutionId }));
console.log(result.QueryExecution.Status);
import boto3
client = boto3.client('athena',
endpoint_url='http://localhost:4566',
region_name='us-east-1',
aws_access_key_id='test',
aws_secret_access_key='test')
response = client.start_query_execution(
QueryString='SELECT * FROM my_table',
WorkGroup='primary')
result = client.get_query_execution(
QueryExecutionId=response['QueryExecutionId'])
print(result['QueryExecution']['Status'])
cloudmock.yml
services:
athena:
enabled: true
  • Queries are not actually executed against any data source
  • Query results return stub/empty data
  • Query execution status transitions are simulated