airflow.providers.amazon.aws.operators.redshift_data

Module Contents

Classes

RedshiftDataOperator

Executes SQL Statements against an Amazon Redshift cluster using Redshift Data

class airflow.providers.amazon.aws.operators.redshift_data.RedshiftDataOperator(database, sql, cluster_identifier=None, db_user=None, parameters=None, secret_arn=None, statement_name=None, with_event=False, await_result=True, poll_interval=10, aws_conn_id='aws_default', region=None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Executes SQL Statements against an Amazon Redshift cluster using Redshift Data

See also

For more information on how to use this operator, take a look at the guide: Execute a statement on an Amazon Redshift Cluster

Parameters
  • database (str) – the name of the database

  • sql (str) – the SQL statement text to run

  • cluster_identifier (Optional[str]) – unique identifier of a cluster

  • db_user (Optional[str]) – the database username

  • parameters (Optional[list]) – the parameters for the SQL statement

  • secret_arn (Optional[str]) – the name or ARN of the secret that enables db access

  • statement_name (Optional[str]) – the name of the SQL statement

  • with_event (bool) – indicates whether to send an event to EventBridge

  • await_result (bool) – indicates whether to wait for a result, if True wait, if False don’t wait

  • poll_interval (int) – how often in seconds to check the query status

  • aws_conn_id (str) – aws connection to use

  • region (Optional[str]) – aws region to use

template_fields = ['cluster_identifier', 'database', 'sql', 'db_user', 'parameters', 'statement_name',...[source]
template_ext = ['.sql'][source]
template_fields_renderers[source]
hook(self)[source]

Create and return an RedshiftDataHook.

execute_query(self)[source]
wait_for_results(self, statement_id)[source]
execute(self, context)[source]

Execute a statement against Amazon Redshift

on_kill(self)[source]

Cancel the submitted redshift query

Was this entry helpful?