airflow.providers.google.cloud.transfers.cassandra_to_gcs¶
此模組包含用於將資料從 Cassandra 以 JSON 格式複製到 Google Cloud Storage 的運算子。
屬性¶
類¶
將資料從 Cassandra 以 JSON 格式複製到 Google Cloud Storage。 |
模組內容¶
- class airflow.providers.google.cloud.transfers.cassandra_to_gcs.CassandraToGCSOperator(*, cql, bucket, filename, schema_filename=None, approx_max_file_size_bytes=1900000000, gzip=False, cassandra_conn_id='cassandra_default', gcp_conn_id='google_cloud_default', impersonation_chain=None, query_timeout=NOT_SET, encode_uuid=True, **kwargs)[source]¶
基類:
airflow.models.BaseOperator將資料從 Cassandra 以 JSON 格式複製到 Google Cloud Storage。
注意:不支援陣列的陣列。
- 引數:
cql (str) – 在 Cassandra 表上執行的 CQL。
bucket (str) – 要上傳到的儲存桶。
filename (str) – 上傳到 Google Cloud Storage 時用作物件名稱的檔名。檔名中應指定 {},以便運算子在檔案因大小拆分時注入檔案編號。
schema_filename (str | None) – 如果設定,則這是上傳包含從 MySQL 匯出的表對應的 BigQuery 模式欄位的 .json 檔案時用作物件名稱的檔名。
approx_max_file_size_bytes (int) – 此運算子支援將大型表匯出拆分成多個檔案的功能(參見上面檔名引數文件中的注意事項)。此引數允許開發者指定拆分後的檔案大小。請檢視 https://cloud.google.com/storage/quotas 以瞭解單個物件的最大允許檔案大小。
cassandra_conn_id (str) – 對特定 Cassandra Hook 的引用。
gzip (bool) – 上傳時壓縮檔案的選項
gcp_conn_id (str) – (可選)用於連線到 Google Cloud 的連線 ID。
impersonation_chain (str | collections.abc.Sequence[str] | None) – (可選)用於使用短期憑據模擬的服務賬號,或獲取列表中最後一個賬號的 access_token 所需的鏈式賬號列表,該賬號將在請求中被模擬。如果設定為字串,該賬號必須授予原始賬號 Service Account Token Creator IAM 角色。如果設定為序列,列表中的身份必須授予緊前身份 Service Account Token Creator IAM 角色,列表中第一個賬號將此角色授予原始賬號(模板化)。
query_timeout (float | None | NotSetType) – (可選)執行 Cassandra 查詢所用的時間量,以秒為單位。如果未設定,超時值將由 Cassandra 驅動程式在 Session.execute() 中設定。如果設定為 None,則沒有超時。
encode_uuid (bool) – (可選)從 Cassandra 上傳到 GCS 時是否編碼 UUID 的選項。預設為編碼 UUID。
- template_fields: collections.abc.Sequence[str] = ('cql', 'bucket', 'filename', 'schema_filename', 'impersonation_chain')[source]¶
- template_ext: collections.abc.Sequence[str] = ('.cql',)[source]¶
- convert_user_type(value)[source]¶
將使用者型別轉換為包含 n 個欄位的 RECORD,其中 n 是屬性的數量。
使用者型別類中的每個元素都將轉換為其在 BQ 中的相應資料型別。