Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
The underlying issue is on how Databricks SQL processes aggregation functions in the alert trigger criteria. When you configure the alert condition using an aggregate like MIN, MAX, AVG or SUM, the alert engine runs an evaluation pass that collapses the entire result set into a single scalar row. That single-row context gets passed into the result table variable in your notification template, which is why email only renders one record.
To preserve the complete table in your notification, switch the alert condition setting from MIN to FIRST_ROW. Using FIRST_ROW instructs the alert to evaluate the trigger criteria against the first record's value while keeping the full query result set intact. The notification variable will then render all returned rows from your query up to the limit of 100 rows.