airflow.providers.common.sql.operators.generic_transfer¶
Classes¶
| Moves data from a connection to another. | 
Module Contents¶
- class airflow.providers.common.sql.operators.generic_transfer.GenericTransfer(*, sql, destination_table, source_conn_id, source_hook_params=None, destination_conn_id, destination_hook_params=None, preoperator=None, insert_args=None, page_size=None, paginated_sql_statement_clause=None, **kwargs)[source]¶
- Bases: - airflow.providers.common.sql.version_compat.BaseOperator- Moves data from a connection to another. - Assuming that they both provide the required methods in their respective hooks. The source hook needs to expose a get_records method, and the destination a insert_rows method. - This is meant to be used on small-ish datasets that fit in memory. - Parameters:
- sql (str) – SQL query to execute against the source database. (templated) 
- destination_table (str) – target table. (templated) 
- source_conn_id (str) – source connection. (templated) 
- source_hook_params (dict | None) – source hook parameters. 
- destination_conn_id (str) – destination connection. (templated) 
- destination_hook_params (dict | None) – destination hook parameters. 
- preoperator (str | list[str] | None) – sql statement or list of statements to be executed prior to loading the data. (templated) 
- insert_args (dict | None) – extra params for insert_rows method. 
- page_size (int | None) – number of records to be read in paginated mode (optional). 
- paginated_sql_statement_clause (str | None) – SQL statement clause to be used for pagination (optional). 
 
 - template_fields: collections.abc.Sequence[str] = ('source_conn_id', 'destination_conn_id', 'sql', 'destination_table', 'preoperator',...[source]¶
 - template_ext: collections.abc.Sequence[str] = ('.sql', '.hql')[source]¶
 - classmethod get_hook(conn_id, hook_params=None)[source]¶
- Return DbApiHook for this connection id. - Parameters:
- Returns:
- DbApiHook for this connection 
- Return type:
 
 - property source_hook: airflow.providers.common.sql.hooks.sql.DbApiHook[source]¶
 - property destination_hook: airflow.providers.common.sql.hooks.sql.DbApiHook[source]¶
 - render_template_fields(context, jinja_env=None)[source]¶
- Template all attributes listed in self.template_fields. - This mutates the attributes in-place and is irreversible. - Parameters:
- context (airflow.sdk.definitions.context.Context) – Context dict with values to apply on content. 
- jinja_env (jinja2.Environment | None) – Jinja’s environment to use for rendering.