airflow.providers.presto.transfers.gcs_to_presto¶
本模块包含 Google Cloud Storage 到 Presto 的运算符。
类¶
将 Google Cloud Storage 中的 CSV 文件加载到 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
将 Google Cloud Storage 中的 CSV 文件加载到 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 连接 ID
gcp_conn_id (str) – (可选)用于连接到 Google Cloud 并与 Google Cloud Storage 服务交互的连接 ID。
impersonation_chain (str | collections.abc.Sequence[str] | None) – 可选的服务账号,用于使用短期凭证进行模拟,或者是一个由多个账号组成的链式列表,需要通过该列表获取最后一个账号的 access_token,并将在请求中模拟该账号。如果设置为字符串,则起始账号必须已获得该服务账号的“服务账号令牌创建者”(Service Account Token Creator)IAM 角色。如果设置为序列,则列表中的身份必须向其直接前一个身份授予“服务账号令牌创建者”IAM 角色,列表中的第一个账号向起始账号授予此角色。
- template_fields: collections.abc.Sequence[str] = ('source_bucket', 'source_object', 'presto_table')[source]¶