airflow.providers.amazon.aws.operators.athena¶
类¶
提交 Trino/Presto 查询到 Amazon Athena 的 Operator。 |
模块内容¶
- 类 airflow.providers.amazon.aws.operators.athena.AthenaOperator(*, query, database, output_location=None, client_request_token=None, workgroup='primary', query_execution_context=None, result_configuration=None, sleep_time=30, max_polling_attempts=None, log_query=True, deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), catalog='AwsDataCatalog', **kwargs)[source]¶
基类:
airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator
[airflow.providers.amazon.aws.hooks.athena.AthenaHook
]提交 Trino/Presto 查询到 Amazon Athena 的 Operator。
注意
如果在任务运行时被杀死,它会取消已启动的 athena 查询,除非在可延迟模式下运行。
另请参阅
有关如何使用此 operator 的更多信息,请参阅指南:在 Amazon Athena 中运行查询
- 参数::
query (str) – 要在 Amazon Athena 上运行的 Trino/Presto 查询。(templated)
database (str) – 要选择的数据库。(templated)
catalog (str) – 要选择的 Catalog。(templated)
output_location (str | None) – 用于写入查询结果的 S3 路径。(templated) 要运行查询,您必须通过以下方式之一指定查询结果位置:使用此设置(客户端)针对单个查询,或在工作组中使用 WorkGroupConfiguration。如果两者都没有设置,Athena 将发出错误,指示未提供输出位置。
client_request_token (str | None) – 用户创建的唯一令牌,用于避免多次执行同一个查询。
workgroup (str) – 运行查询的 Athena 工作组。(templated)
query_execution_context (dict[str, str] | None) – 需要运行查询的上下文。
result_configuration (dict[str, Any] | None) – 包含存储结果路径和加密相关配置的字典。
sleep_time (int) – 两次连续检查 Athena 查询状态调用之间的等待时间(秒)。
max_polling_attempts (int | None) – 函数退出前轮询查询状态的次数。要限制任务执行时间,请使用 execution_timeout。
log_query (bool) – 执行 athena 查询及其他执行参数时是否记录日志。默认为 True。
aws_conn_id – 用于 AWS 凭证的 Airflow 连接。如果此参数为
None
或为空,则使用默认的 boto3 行为。如果在分布式模式下运行 Airflow 并且 aws_conn_id 为 None 或为空,则将使用默认的 boto3 配置(且必须在每个 worker 节点上维护)。region_name – AWS region_name。如果未指定,则使用默认的 boto3 行为。
verify – 是否验证 SSL 证书。请参阅: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config – botocore 客户端的配置字典(键值对)。请参阅: https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- template_fields: collections.abc.Sequence[str][source]¶
- template_ext: collections.abc.Sequence[str] = ('.sql',)[source]¶