airflow.providers.amazon.aws.transfers.s3_to_redshift¶
属性¶
类¶
执行 COPY 命令以从 S3 加载文件到 Redshift。 |
模块内容¶
- airflow.providers.amazon.aws.transfers.s3_to_redshift.AVAILABLE_METHODS = ['APPEND', 'REPLACE', 'UPSERT'][源码]¶
- class airflow.providers.amazon.aws.transfers.s3_to_redshift.S3ToRedshiftOperator(*, table, s3_bucket, s3_key, schema=None, redshift_conn_id='redshift_default', aws_conn_id=NOTSET, verify=None, column_list=None, copy_options=None, autocommit=False, method='APPEND', upsert_keys=None, redshift_data_api_kwargs=None, **kwargs)[源码]¶
基类:
airflow.models.BaseOperator
执行 COPY 命令以从 S3 加载文件到 Redshift。
另请参阅
有关如何使用此操作符的更多信息,请参阅指南: Amazon S3 到 Amazon Redshift 传输操作符
- 参数:
table (str) – 引用 Redshift 数据库中的特定表
s3_bucket (str) – 引用特定的 S3 存储桶
s3_key (str) – 选择 S3 中单个或多个对象的键前缀
schema (str | None) – 引用 Redshift 数据库中的特定模式。复制到临时表时无需提供
redshift_conn_id (str) – 引用特定的 Redshift 数据库 或 Redshift Data API 连接
aws_conn_id (str | None | airflow.utils.types.ArgNotSet) – 引用特定的 S3 连接。如果 AWS 连接在其
extras
中包含 ‘aws_iam_role’,则操作符将使用带有令牌的 AWS STS 凭据 https://docs.aws.amazon.com/redshift/latest/dg/copy-parameters-authorization.html#copy-credentials是否验证 S3 连接的 SSL 证书。默认情况下,SSL 证书会进行验证。您可以提供以下值
False
:不验证 SSL 证书。SSL 仍将使用(除非 use_ssl 为 False),但 SSL 证书不会被验证。(unless use_ssl is False), but SSL certificates will not be verified.
path/to/cert/bundle.pem
:要使用的 CA 证书包的文件名。您可以指定此参数来使用与 botocore 使用的不同的 CA 证书包。
column_list (list[str] | None) – 将源数据字段加载到特定目标列中的列名列表 https://docs.aws.amazon.com/redshift/latest/dg/copy-parameters-column-mapping.html#copy-column-list
copy_options (list | None) – 引用 COPY 选项列表
method (str) – 执行时要执行的操作。可用值包括
APPEND
、UPSERT
和REPLACE
。redshift_data_api_kwargs (dict | None) – 如果使用 Redshift Data API 而不是基于 SQL 的连接,这是 hook 的
execute_query
方法的参数字典。不能包含以下任何 kwargs:{'sql', 'parameters'}
- template_fields: collections.abc.Sequence[str] = ('s3_bucket', 's3_key', 'schema', 'table', 'column_list', 'copy_options', 'redshift_conn_id',...[源码]¶
- template_ext: collections.abc.Sequence[str] = ()[源码]¶