airflow.providers.presto.transfers.gcs_to_presto

此模組包含 Google Cloud Storage 至 Presto 運算子。

模組內容

類別

GCSToPrestoOperator

將 csv 檔案從 Google Cloud Storage 載入到 Presto 資料表。

class airflow.providers.presto.transfers.gcs_to_presto.GCSToPrestoOperator(*, source_bucket, source_object, presto_table, presto_conn_id='presto_default', gcp_conn_id='google_cloud_default', schema_fields=None, schema_object=None, impersonation_chain=None, **kwargs)[source]

基底類別: airflow.models.BaseOperator

將 csv 檔案從 Google Cloud Storage 載入到 Presto 資料表。

假設: 1. CSV 檔案不應包含標頭 2. 具有必要欄位的 Presto 資料表已建立 3. (可選)可以提供包含標頭或標頭清單的個別 JSON 檔案

參數
  • source_bucket (str) – 包含 csv 的來源 GCS 儲存桶

  • source_object (str) – csv 檔案,包含路徑

  • presto_table (str) – 要上傳資料的 presto 資料表

  • presto_conn_id (str) – 目的地 presto 連線

  • gcp_conn_id (str) – (可選)用於連線至 Google Cloud 並與 Google Cloud Storage 服務互動的連線 ID。

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – 可選的服務帳戶,用於模擬使用短期憑證,或取得清單中最後一個帳戶的 access_token 所需的鏈結帳戶清單,該帳戶將在請求中被模擬。如果設定為字串,則帳戶必須授予原始帳戶「服務帳戶權杖建立者」IAM 角色。如果設定為序列,則清單中的身分必須將「服務帳戶權杖建立者」IAM 角色授予緊接在前的身分,清單中的第一個帳戶將此角色授予原始帳戶。

template_fields: collections.abc.Sequence[str] = ('source_bucket', 'source_object', 'presto_table')[source]
execute(context)[source]

建立運算子時衍生。

Context 是與渲染 Jinja 範本時使用的字典相同。

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

這個條目有幫助嗎?