ChronusQLReference

Execution logic

Understand operator order, event-time state, emission timing, partitioning, and the difference between finite and continuous input.

Reference

10 min read

Language reference

Logical operator order

Execution sketchThe compiled flow follows language semantics
JSONInput
TIMESTAMP BYEvent time
WHERE / SELECTFilter / project
WINDOW / MATCH / MODELTemporal state
INTOOutput
Textual clause position and logical execution are related but not identical. ChronusQL compiles each concern into a typed operator pipeline.
  1. 01
    Read and timestamp

    Decode the JSON object and resolve its event time.

  2. 02
    Filter source events

    Apply the pre-aggregation `WHERE` predicate.

  3. 03
    Partition temporal state

    Use group, session, pattern, or model keys.

  4. 04
    Evaluate stateful logic

    Aggregate, compute window statistics, recognize patterns, or update a model.

  5. 05
    Apply post-state conditions

    Evaluate `HAVING` or a post-`COMPUTE` filter.

  6. 06
    Project and emit

    Build the result object and route it to the named output.

When results become visible

Query shapeEmission behavior
Projection / filterEmits as each accepted event is processed.
Finite unwindowed aggregateFlushes final aggregate rows when the input completes.
Aggregate windowEmits when the event-time window closes; output time is the window end.
Session windowEmits at timeout or maximum-duration split, and flushes remaining sessions on finite completion.
Window computePreserves per-event multiplicity and original event timestamps while adding window values.
MATCH_RECOGNIZEEmits one measured row after a successful complete pattern.
Temporal MLUpdates model state and emits computed values as records become eligible.

Partitioning is semantic isolation

A partition key is more than a display group. It prevents state from unrelated entities from mixing. Driver A does not share a session, pattern candidate, rolling statistic, or model state with Driver B when driver is the partition key.

Finite and continuous execution

Finite

Input completes

Final aggregate and session state can be flushed deterministically at end of input.

Continuous

Input remains open

The runtime keeps state and emits only when temporal conditions make a result complete.