airflow.providers.google.cloud.transfers.cassandra_to_gcs
¶
此模組包含用於將資料從 Cassandra 複製到 Google Cloud Storage (JSON 格式) 的運算子。
模組內容¶
類別¶
以 JSON 格式將資料從 Cassandra 複製到 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)[原始碼]¶
基底類別:
airflow.models.BaseOperator
以 JSON 格式將資料從 Cassandra 複製到 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) – 此運算子支援將大型表格傾印分割成多個檔案的功能 (請參閱上方 filename 參數文件中的注意事項)。此參數允許開發人員指定分割檔案的大小。請查看 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 所需的鏈式帳戶列表,該帳戶將在請求中被模擬。如果設定為字串,則該帳戶必須授予原始帳戶「服務帳戶權杖建立者」IAM 角色。如果設定為序列,則列表中的身分必須將「服務帳戶權杖建立者」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')[原始碼]¶
- template_ext: collections.abc.Sequence[str] = ('.cql',)[原始碼]¶
- convert_user_type(value)[原始碼]¶
將使用者類型轉換為包含 n 個欄位的 RECORD,其中 n 為屬性數量。
使用者類型類別中的每個元素都將轉換為其在 BQ 中對應的資料類型。