airflow.providers.mysql.transfers.trino_to_mysql

模組內容

類別

TrinoToMySqlOperator

將資料從 Trino 移動到 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)[原始碼]

基底類別: airflow.models.BaseOperator

將資料從 Trino 移動到 MySQL。

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

參數
  • sql (str) – 要針對 Trino 執行的 SQL 查詢。(已套用範本)

  • mysql_table (str) – 目標 MySQL 資料表,使用點記號來指定特定資料庫。(已套用範本)

  • mysql_conn_id (str) – 參考 mysql 連線 ID

  • trino_conn_id (str) – 來源 trino 連線

  • mysql_preoperator (str | None) – 在匯入之前針對 mysql 執行的 sql 語句,通常用於截斷或刪除即將到來的資料,使任務具有等冪性(執行任務兩次不會重複載入資料)。(已套用範本)

template_fields: collections.abc.Sequence[str] = ('sql', 'mysql_table', 'mysql_preoperator')[原始碼]
template_ext: collections.abc.Sequence[str] = ('.sql',)[原始碼]
template_fields_renderers[原始碼]
ui_color = '#a0e08c'[原始碼]
execute(context)[原始碼]

在建立運算子時衍生。

Context 是與呈現 jinja 範本時使用的字典相同。

請參閱 get_template_context 以取得更多上下文。

此條目是否有幫助?