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: 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 :Sequence[str] = ['sql'][source]
template_ext :Sequence[str] = ['.sql'][source]
get_hook(self) airflow.providers.amazon.aws.hooks.redshift_sql.RedshiftSQLHook[source]

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

execute(self, context: airflow.utils.context.Context) None[source]

Execute a statement against Amazon Redshift

Was this entry helpful?