airflow.providers.mysql.transfers.trino_to_mysql

Module Contents

Classes

TrinoToMySqlOperator

Moves data from Trino to MySQL.

class airflow.providers.mysql.transfers.trino_to_mysql.TrinoToMySqlOperator(*, sql, mysql_table, trino_conn_id='trino_default', mysql_conn_id='mysql_default', mysql_preoperator=None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Moves data from Trino to MySQL.

Note that for now the data is loaded into memory before being pushed to MySQL, so this operator should be used for smallish amount of data.

Parameters
  • sql (str) – SQL query to execute against Trino. (templated)

  • mysql_table (str) – target MySQL table, use dot notation to target a specific database. (templated)

  • mysql_conn_id (str) – Reference to mysql connection id.

  • trino_conn_id (str) – source trino connection

  • mysql_preoperator (str | None) – sql statement to run against mysql prior to import, typically use to truncate of delete in place of the data coming in, allowing the task to be idempotent (running the task twice won’t double load data). (templated)

template_fields: Sequence[str] = ('sql', 'mysql_table', 'mysql_preoperator')[source]
template_ext: Sequence[str] = ('.sql',)[source]
template_fields_renderers[source]
ui_color = '#a0e08c'[source]
execute(context)[source]

Derive when creating an operator.

Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

Was this entry helpful?