airflow.providers.amazon.aws.transfers.s3_to_redshift

屬性

AVAILABLE_METHODS

S3ToRedshiftOperator

執行 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

  • verify (bool | str | None) –

    是否驗證 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) – 執行時要執行的操作。可用值包括 APPENDUPSERTREPLACE

  • upsert_keys (list[str] | None) – 在 UPSERT 操作中用作鍵的欄位列表

  • 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] = ()[原始碼]
ui_color = '#99e699'[原始碼]
schema = None[原始碼]
table[原始碼]
s3_bucket[原始碼]
s3_key[原始碼]
redshift_conn_id = 'redshift_default'[原始碼]
aws_conn_id[原始碼]
verify = None[原始碼]
column_list = None[原始碼]
copy_options = [][原始碼]
autocommit = False[原始碼]
method = 'APPEND'[原始碼]
upsert_keys = None[原始碼]
redshift_data_api_kwargs[原始碼]
property use_redshift_data[原始碼]
execute(context)[原始碼]

建立運算子時派生。

Context 與渲染 jinja 模板時使用的字典相同。

有關更多上下文,請參閱 get_template_context。

get_openlineage_facets_on_complete(task_instance)[原始碼]

實現 on_complete,因為我們將查詢目標表。

此條目有幫助嗎?