Supported in: Streaming
Detects when a record hasn't been seen for a configurable amount of time for a set of keys.
Transform categories: Other
Description: The first record from sensor_1 at time 00:00:00 triggers an alive heartbeat detection. The second record at 00:00:05 extends the timeout but does not emit a new detection. The third record from sensor_2 at 00:00:20 advances the watermark past 00:00:15, causing sensor_1's timeout timer to fire and marking its heartbeat as missed. The sensor_2 record also triggers its own alive detection.
Argument values:
SECONDSsensor_id}Input:
| row_order | sensor_id | temperature | measurement_timestamp |
|---|---|---|---|
| 3 | sensor_2 | 19.8 | 2024-09-30T00:00:20 |
| 2 | sensor_1 | 21.0 | 2024-09-30T00:00:05 |
| 1 | sensor_1 | 20.5 | 2024-09-30T00:00:00 |
Output:
| sensor_id | alive | detection_time |
|---|---|---|
| sensor_1 | true | 2024-09-30T00:00:00Z |
| sensor_1 | false | 2024-09-30T00:00:15Z |
| sensor_2 | true | 2024-09-30T00:00:20Z |
Description: Each partition key maintains independent state and timers, but all keys share the same global watermark. sensor_1 sends data at 00:00:00 and sensor_2 at 00:00:05. The record from sensor_3 at 00:00:20 advances the watermark past both timeout thresholds, causing sensor_1's timer at 00:00:10 and sensor_2's timer at 00:00:15 to fire in sequence, marking both as missed.
Argument values:
SECONDSsensor_id}Input:
| row_order | sensor_id | temperature | measurement_timestamp |
|---|---|---|---|
| 3 | sensor_3 | 22.1 | 2024-09-30T00:00:20 |
| 2 | sensor_2 | 18.3 | 2024-09-30T00:00:05 |
| 1 | sensor_1 | 20.5 | 2024-09-30T00:00:00 |
Output:
| sensor_id | alive | detection_time |
|---|---|---|
| sensor_1 | true | 2024-09-30T00:00:00Z |
| sensor_2 | true | 2024-09-30T00:00:05Z |
| sensor_1 | false | 2024-09-30T00:00:10Z |
| sensor_2 | false | 2024-09-30T00:00:15Z |
| sensor_3 | true | 2024-09-30T00:00:20Z |