airflow.providers.yandex.operators.yq

YQExecuteQueryOperator

使用 Yandex Query 服務執行 SQL 程式碼。

模組內容

class airflow.providers.yandex.operators.yq.YQExecuteQueryOperator(*, name=None, folder_id=None, yandex_conn_id=None, public_ssh_key=None, service_account_id=None, sql, **kwargs)[source]

基類: airflow.models.BaseOperator

使用 Yandex Query 服務執行 SQL 程式碼。

引數:
  • sql (str) – 作為單個字串執行的 SQL 程式碼

  • name (str | None) – 在 YandexQuery 中的查詢名稱

  • folder_id (str | None) – 用於建立查詢的雲資料夾 ID

  • yandex_conn_id (str | None) – 用於獲取引數的 Airflow 連線 ID

template_fields: collections.abc.Sequence[str] = ('sql',)[source]
template_fields_renderers[source]
template_ext: collections.abc.Sequence[str] = ('.sql',)[source]
ui_color = '#ededed'[source]
name = None[source]
folder_id = None[source]
yandex_conn_id = None[source]
public_ssh_key = None[source]
service_account_id = None[source]
sql[source]
query_id: str | None = None[source]
property hook: airflow.providers.yandex.hooks.yq.YQHook[source]

獲取有效的 hook。

execute(context)[source]

建立運算子時派生。

Context 是渲染 Jinja 模板時使用的相同字典。

參考 get_template_context 獲取更多上下文資訊。

on_kill()[source]

重寫此方法以在任務例項被殺死時清理子程序。

運算子內任何對 threading、subprocess 或 multiprocessing 模組的使用都需要清理,否則會留下殭屍程序。

此條目有幫助嗎?