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]

Bases: airflow.models.BaseOperator

將資料從 Presto 移動到 MySQL。

請注意,目前資料在推送到 MySQL 之前會先載入到記憶體中,因此此運算子應用於少量資料。

參數
  • 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]
execute(context)[source]

在建立運算子時衍生。

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

請參考 get_template_context 以獲得更多上下文資訊。

這個條目是否有幫助?