airflow.providers.apache.hive.sensors.hive_partition

HivePartitionSensor

等待 Hive 中出現一個分割槽。

模組內容

class airflow.providers.apache.hive.sensors.hive_partition.HivePartitionSensor(*, table, partition="ds='{{ ds }}'", metastore_conn_id='metastore_default', schema='default', poke_interval=60 * 3, **kwargs)[source]

Bases: airflow.sensors.base.BaseSensorOperator

等待 Hive 中出現一個分割槽。

注意:由於 partition 支援通用邏輯運算子,因此可能效率低下。如果您不需要 HivePartitionSensor 的全部靈活性,請考慮使用 NamedHivePartitionSensor。

引數:
  • table (str) – 要等待的表的名稱,支援點表示法 (my_database.my_table)

  • partition (str | None) – 要等待的分割槽子句。這會直接傳遞給 metastore Thrift 客戶端的 get_partitions_by_filter 方法,並且顯然支援類似 SQL 的表示法,例如 ds='2015-01-01' AND type='value',以及比較運算子,例如 "ds>=2015-01-01"

  • metastore_conn_id (str) – 對 :ref: metastore thrift 服務連線 ID <howto/connection:hive_metastore> 的引用

template_fields: collections.abc.Sequence[str] = ('schema', 'table', 'partition')[source]
ui_color = '#C5CAE9'[source]
metastore_conn_id = 'metastore_default'[source]
table[source]
partition = "ds='{{ ds }}'"[source]
schema = 'default'[source]
poke(context)[source]

在此類派生時重寫。

此條目是否有幫助?