airflow.providers.amazon.aws.operators.redshift_sql

Module Contents

Classes

RedshiftSQLOperator

Executes SQL Statements against an Amazon Redshift cluster

class airflow.providers.amazon.aws.operators.redshift_sql.RedshiftSQLOperator(*, sql, redshift_conn_id='redshift_default', parameters=None, autocommit=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: Amazon Redshift

Parameters
  • sql (Union[str, Iterable[str]]) -- the SQL code to be executed as a single string, or a list of str (sql statements), or a reference to a template file. Template references are recognized by str ending in '.sql'

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

  • parameters (Optional[Union[Iterable, Mapping]]) -- (optional) the parameters to render the SQL query with.

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

template_fields :Sequence[str] = ['sql'][source]
template_ext :Sequence[str] = ['.sql'][source]
template_fields_renderers[source]
get_hook()[source]

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

execute(context)[source]

Execute a statement against Amazon Redshift

Was this entry helpful?