AWS Athena Query icon

AWS Athena Query

Execute SQL queries on AWS Athena

AWS Athena Query

AI-generated

Summary

Execute a SQL query on AWS Athena and return the results in a specified format.

Inputs

  • Region (required) — AWS region where the Athena service is located, e.g., 'us-east-1'.
  • Database Name — Optional name of the Athena database to query. Leave empty to use the default database.
  • SQL Query (required) — The SQL query string to execute in Athena.
  • S3 Output Location (required) — The S3 bucket path where Athena will save the query results, e.g., 's3://my-bucket/athena-results/'.
  • Query Timeout (Seconds) (required) — Maximum time in seconds to wait for the query to complete. Defaults to 300 seconds.
  • Output Format (required) — Determines the structure of returned data: 'Table Format' returns each database row as a separate workflow item; 'Raw Format' returns all results in a single item with metadata including query ID and row count.
  • Max Rows Returned (required) — Controls row count limit: 'No Limit' returns all available rows; 'Limit Applied' returns up to a specified maximum.
  • Max Rows — When 'Limit Applied' is selected, sets the maximum number of rows to return. Must be a positive integer.

Output shape

A list of workflow items or a single workflow item depending on Output Format.

In 'Table Format', each row from the query result becomes a separate item with its fields as properties. In 'Raw Format', all rows and columns are returned in one item under 'results' along with metadata such as 'queryExecutionId', 'rowCount', and 'columns'. If 'Limit Applied' is selected, the results are truncated to the specified maximum number of rows. If the query yields no rows, an empty result is returned accordingly. Execution errors will throw node errors unless 'Continue On Fail' is enabled, in which case errors are paired with their respective inputs.

Discussion