blob: 4f6a9eebd74474412b16d6430450d5a165205e54 [file] [log] [blame]
:mod:`airflow.contrib.operators.aws_athena_operator`
====================================================
.. py:module:: airflow.contrib.operators.aws_athena_operator
Module Contents
---------------
.. py:class:: AWSAthenaOperator(query, database, output_location, aws_conn_id='aws_default', client_request_token=None, query_execution_context=None, result_configuration=None, sleep_time=30, max_tries=None, workgroup='primary', *args, **kwargs)
Bases: :class:`airflow.models.BaseOperator`
An operator that submit presto query to athena.
If ``do_xcom_push`` is True, the QueryExecutionID assigned to the
query will be pushed to an XCom when it successfuly completes.
:param query: Presto to be run on athena. (templated)
:type query: str
:param database: Database to select. (templated)
:type database: str
:param output_location: s3 path to write the query results into. (templated)
:type output_location: str
:param aws_conn_id: aws connection to use
:type aws_conn_id: str
:param sleep_time: Time to wait between two consecutive call to check query status on athena
:type sleep_time: int
:param max_tries: Number of times to poll for query state before function exits
:type max_triex: int
.. attribute:: ui_color
:annotation: = #44b5e2
.. attribute:: template_fields
:annotation: = ['query', 'database', 'output_location']
.. attribute:: template_ext
:annotation: = ['.sql']
.. method:: get_hook(self)
.. method:: execute(self, context)
Run Presto Query on Athena
.. method:: on_kill(self)
Cancel the submitted athena query