airflow.providers.amazon.aws.operators.redshift

Module Contents

class airflow.providers.amazon.aws.operators.redshift.RedshiftSQLOperator(*, sql: Optional[Union[Dict, Iterable]], redshift_conn_id: str = 'redshift_default', parameters: Optional[dict] = None, autocommit: bool = True, **kwargs)[source]

Bases: airflow.models.BaseOperator

Executes SQL Statements against an Amazon Redshift cluster

See also

For more information on how to use this operator, take a look at the guide: RedshiftSQLOperator

Parameters
  • sql (Can receive a str representing a sql statement, or an iterable of str (sql statements)) -- the sql code to be executed

  • redshift_conn_id (str) -- reference to Amazon Redshift connection id

  • parameters (dict or iterable) -- (optional) the parameters to render the SQL query with.

  • autocommit (bool) -- if True, each command is automatically committed. (default value: False)

template_fields = ['sql'][source]
template_ext = ['.sql'][source]
get_hook(self)[source]

Create and return RedshiftSQLHook. :return RedshiftSQLHook: A RedshiftSQLHook instance.

execute(self, context: dict)[source]

Execute a statement against Amazon Redshift

Was this entry helpful?