An operator that submits a presto query to athena.

View on GitHub

Last Updated: Dec. 4, 2022

Access Instructions

Install the Amazon provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.


queryRequiredPresto to be run on athena. (templated)
databaseRequiredDatabase to select. (templated)
output_locationRequireds3 path to write the query results into. (templated)
aws_conn_idaws connection to use
client_request_tokenUnique token created by user to avoid multiple executions of same query
workgroupAthena workgroup in which query will be run
query_execution_contextContext in which query need to be run
result_configurationDict with path to store results in and config related to encryption
sleep_timeTime (in seconds) to wait between two consecutive calls to check query status on Athena
max_triesDeprecated - use max_polling_attempts instead.
max_polling_attemptsNumber of times to poll for query state before function exits To limit task execution time, use execution_timeout.
log_queryWhether to log athena query and other execution params when it’s executed. Defaults to True.


An operator that submits a presto query to athena.

See also

For more information on how to use this operator, take a look at the guide: Run a query in Amazon Athena

Was this page helpful?