airflow.providers.mysql.transfers.presto_to_mysql

PrestoToMySqlOperator

將資料從 Presto 移動到 MySQL。

模組內容

class airflow.providers.mysql.transfers.presto_to_mysql.PrestoToMySqlOperator(*, sql, mysql_table, presto_conn_id='presto_default', mysql_conn_id='mysql_default', mysql_preoperator=None, **kwargs)[source]

基類: airflow.models.BaseOperator

將資料從 Presto 移動到 MySQL。

注意,目前資料在推送到 MySQL 之前會載入到記憶體中,因此此 operator 應該用於處理少量資料。

引數:
  • sql (str) – 要在 Presto 上執行的 SQL 查詢。(模板化)

  • mysql_table (str) – 目標 MySQL 表,使用點表示法指定特定資料庫。(模板化)

  • mysql_conn_id (str) – mysql 連線 ID 的引用。

  • presto_conn_id (str) – 源 presto 連線

  • mysql_preoperator (str | None) – 在匯入之前在 mysql 上執行的 sql 語句,通常用於截斷或刪除傳入資料的位置,使任務具有冪等性(執行兩次任務不會重複載入資料)。(模板化)

template_fields: collections.abc.Sequence[str] = ('sql', 'mysql_table', 'mysql_preoperator')[source]
template_ext: collections.abc.Sequence[str] = ('.sql',)[source]
template_fields_renderers[source]
ui_color = '#a0e08c'[source]
sql[source]
mysql_table[source]
mysql_conn_id = 'mysql_default'[source]
mysql_preoperator = None[source]
presto_conn_id = 'presto_default'[source]
execute(context)[source]

建立 operator 時派生此方法。

Context 是與渲染 jinja 模板時使用的字典相同。

有關更多上下文,請參閱 get_template_context。

此條目有用嗎?