多个列上的警报Alert on multiple columns

重要

此功能目前以公共预览版提供。This feature is in Public Preview. 请联系 Azure Databricks 代表,以申请访问权限。Contact your Azure Databricks representative to request access.

若要基于查询的多个列设置警报,查询可实现警报逻辑,并返回一个布尔值作为警报触发阈值。To set an alert based on multiple columns of a query, your query can implement the alert logic and return a boolean value for the alert to trigger on. 例如:For example:

SELECT CASE WHEN drafts_count > 10000 AND archived_count > 5000 THEN 1 ELSE 0 END
FROM (
SELECT sum(CASE WHEN is_archived THEN 1 ELSE 0 END) AS archived_count,
sum(CASE WHEN is_draft THEN 1 ELSE 0 END) AS drafts_count
FROM queries) data

drafts_count > 10000 and archived_count > 5000 时,此查询将返回 1This query returns 1 when drafts_count > 10000 and archived_count > 5000. 然后,可将警报配置为在值为 1 时触发。Then you can configure the alert to trigger when the value is 1.