airflow.providers.mysql.transfers.s3_to_mysql

模組內容

類別

S3ToMySqlOperator

從 S3 將檔案載入到 MySQL 資料表。

class airflow.providers.mysql.transfers.s3_to_mysql.S3ToMySqlOperator(*, s3_source_key, mysql_table, mysql_duplicate_key_handling='IGNORE', mysql_extra_options=None, aws_conn_id='aws_default', mysql_conn_id='mysql_default', mysql_local_infile=False, **kwargs)[source]

繼承自: airflow.models.BaseOperator

從 S3 將檔案載入到 MySQL 資料表。

參數
  • s3_source_key (str) – 將載入到 MySQL 的檔案路徑 (S3 金鑰)。

  • mysql_table (str) – 資料將傳送到的 MySQL 資料表。

  • mysql_duplicate_key_handling (str) –

    指定重複資料的處理方式。您可以選擇 IGNOREREPLACE

  • mysql_extra_options (str | None) – 指定如何載入資料的 MySQL 選項。

  • aws_conn_id (str | None) – 包含 S3 Bucket 憑證的 S3 連線。

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

  • mysql_local_infile (bool) – 啟用 MySQLHook 上的 local_infile 選項的旗標。這會使用 LOAD DATA LOCAL INFILE 命令直接載入 MySQL。預設值為 False。

template_fields: collections.abc.Sequence[str] = ('s3_source_key', 'mysql_table')[source]
template_ext: collections.abc.Sequence[str] = ()[source]
ui_color = '#f4a460'[source]
execute(context)[source]

執行從 S3 到 MySQL 的傳輸操作。

參數

context (airflow.utils.context.Context) – 執行時提供的上下文。

這個條目是否有幫助?