Query anatomy
Row transformationChronusQL
SELECT device.id AS device_id,
ABS(reading - target) AS deviation
INTO alerts
FROM sensors TIMESTAMP BY ts
WHERE reading IS NOT NULL
AND ABS(reading - target) >= 5- 01FROM
Selects the physical input or CTE that produces records.
- 02TIMESTAMP BY
Resolves the event-time value used by temporal operators.
- 03WHERE
Removes records before projection or grouping.
- 04SELECT
Builds the output object and assigns aliases.
- 05INTO
Routes the result to a named output stream.
Field paths and aliases
Use dot-separated paths for nested JSON. A leading input name or alias qualifies ownership, while the remaining segments locate the value. AS controls the emitted field name; bracketed aliases can target output names that contain punctuation.
| Form | Meaning |
|---|---|
reading | Top-level field from the current input. |
device.location.zone | Nested JSON path. |
t.speed | Field qualified by input alias t. |
value AS reading | Emit the value under a new field name. |
event.data AS [event.name] | Emit a supported bracketed output alias. |
SELECT * | Preserve the complete current record. |
Operators and predicates
| Family | Supported forms |
|---|---|
| Arithmetic | +, -, *, /, %, unary - |
| Comparison | =, <>, !=, >, >=, <, <=, !>, !< |
| Logical | AND, OR, NOT, parentheses |
| Set and range | IN (...), NOT IN (...), BETWEEN, NOT BETWEEN |
| Text | LIKE, NOT LIKE |
| Null | IS NULL, IS NOT NULL |
| Scalar | ABS(expression) |
Composed predicateChronusQL
SELECT ts, sensor_id, reading
INTO output
FROM input TIMESTAMP BY ts
WHERE sensor_id IN ('A', 'B', 'C')
AND reading BETWEEN 20 AND 80
AND status NOT LIKE 'offline%'