airflow.providers.mysql.transfers.vertica_to_mysql

模組內容

類別

VerticaToMySqlOperator

將資料從 Vertica 移動到 MySQL。

class airflow.providers.mysql.transfers.vertica_to_mysql.VerticaToMySqlOperator(sql, mysql_table, vertica_conn_id='vertica_default', mysql_conn_id='mysql_default', mysql_preoperator=None, mysql_postoperator=None, bulk_load=False, *args, **kwargs)[原始碼]

基底類別: airflow.models.BaseOperator

將資料從 Vertica 移動到 MySQL。

參數
  • sql (str) – 要對 Vertica 資料庫執行的 SQL 查詢。(樣板化)

  • vertica_conn_id (str) – 來源 Vertica 連線

  • mysql_table (str) – 目標 MySQL 表格,使用點記法來指定特定的資料庫。(樣板化)

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

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

  • mysql_postoperator (str | None) – 在匯入之後對 MySQL 執行的 sql 語句,通常用於將資料從暫存移動到生產環境並發出清理命令。(樣板化)

  • bulk_load (bool) – 使用 bulk_load 選項的旗標。這會使用 LOAD DATA LOCAL INFILE 命令直接從 Tab 字元分隔的文字檔案載入 MySQL。MySQL 伺服器必須支援透過此命令載入本機檔案(預設為停用)。

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

在建立操作器時衍生。

Context 是與渲染 Jinja 模板時相同的字典。

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

這個條目是否有幫助?