AptlyStar

Athena

Run SQL queries on data in Amazon S3 using AWS Athena

Nutzungsanweisungen

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.

Tools

athena_start_query

Start an SQL query execution in AWS Athena

Eingabe

ParameterTypErforderlichBeschreibung
awsRegionstringJaAWS region (e.g., us-east-1)
awsAccessKeyIdstringJaAWS access key ID
awsSecretAccessKeystringJaAWS secret access key
queryStringstringJaSQL query string to execute
databasestringNeinDatabase name within the catalog
catalogstringNeinData catalog name (default: AwsDataCatalog)
outputLocationstringNeinS3 output location for query results (e.g., s3://bucket/path/)
workGroupstringNeinWorkgroup to execute the query in (default: primary)

Ausgabe

ParameterTypBeschreibung
queryExecutionIdstringUnique ID of the started query execution

athena_get_query_execution

Get the status and details of an Athena query execution

Eingabe

ParameterTypErforderlichBeschreibung
awsRegionstringJaAWS region (e.g., us-east-1)
awsAccessKeyIdstringJaAWS access key ID
awsSecretAccessKeystringJaAWS secret access key
queryExecutionIdstringJaQuery execution ID to check

Ausgabe

ParameterTypBeschreibung
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

Eingabe

ParameterTypErforderlichBeschreibung
awsRegionstringJaAWS region (e.g., us-east-1)
awsAccessKeyIdstringJaAWS access key ID
awsSecretAccessKeystringJaAWS secret access key
queryExecutionIdstringJaQuery execution ID to get results for
maxResultsnumberNeinMaximum number of rows to return (1-999)
nextTokenstringNeinPagination token from a previous request

Ausgabe

ParameterTypBeschreibung
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

Eingabe

ParameterTypErforderlichBeschreibung
awsRegionstringJaAWS region (e.g., us-east-1)
awsAccessKeyIdstringJaAWS access key ID
awsSecretAccessKeystringJaAWS secret access key
queryExecutionIdstringJaQuery execution ID to stop

Ausgabe

ParameterTypBeschreibung
successbooleanWhether the query was successfully stopped

athena_list_query_executions

List recent Athena query execution IDs

Eingabe

ParameterTypErforderlichBeschreibung
awsRegionstringJaAWS region (e.g., us-east-1)
awsAccessKeyIdstringJaAWS access key ID
awsSecretAccessKeystringJaAWS secret access key
workGroupstringNeinWorkgroup to list executions for (default: primary)
maxResultsnumberNeinMaximum number of results (0-50)
nextTokenstringNeinPagination token from a previous request

Ausgabe

ParameterTypBeschreibung
queryExecutionIdsarrayList of query execution IDs
nextTokenstringPagination token for next page

athena_create_named_query

Create a saved/named query in AWS Athena

Eingabe

ParameterTypErforderlichBeschreibung
awsRegionstringJaAWS region (e.g., us-east-1)
awsAccessKeyIdstringJaAWS access key ID
awsSecretAccessKeystringJaAWS secret access key
namestringJaName for the saved query
databasestringJaDatabase the query runs against
queryStringstringJaSQL query string to save
descriptionstringNeinDescription of the named query
workGroupstringNeinWorkgroup to create the named query in

Ausgabe

ParameterTypBeschreibung
namedQueryIdstringID of the created named query

athena_get_named_query

Get details of a saved/named query in AWS Athena

Eingabe

ParameterTypErforderlichBeschreibung
awsRegionstringJaAWS region (e.g., us-east-1)
awsAccessKeyIdstringJaAWS access key ID
awsSecretAccessKeystringJaAWS secret access key
namedQueryIdstringJaNamed query ID to retrieve

Ausgabe

ParameterTypBeschreibung
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

Eingabe

ParameterTypErforderlichBeschreibung
awsRegionstringJaAWS region (e.g., us-east-1)
awsAccessKeyIdstringJaAWS access key ID
awsSecretAccessKeystringJaAWS secret access key
workGroupstringNeinWorkgroup to list named queries for
maxResultsnumberNeinMaximum number of results (0-50)
nextTokenstringNeinPagination token from a previous request

Ausgabe

ParameterTypBeschreibung
namedQueryIdsarrayList of named query IDs
nextTokenstringPagination token for next page

On this page