Language

Filtering

`WHERE` filters events before projection or aggregation.

Guide

`WHERE` filters events before projection or aggregation.

Comparison Operators

ChronusQL supports:

text
=, <>, !=, >, >=, <, <=, !<, !>

Tested query shape:

sql
SELECT value INTO output FROM input WHERE value > 10

Mixed types do not throw for non-comparable rows. The tests filter out string and null values when comparing numerically:

sql
SELECT value INTO output FROM input WHERE value > 10

Tested input:

jsonl
{"value":"11"}
{"value":11}
{"value":null}

Tested output behavior:

json
{"value":11}

LIKE and NOT LIKE

sql
SELECT name INTO output FROM input WHERE name LIKE 'a%'
SELECT name INTO output FROM input WHERE name NOT LIKE 'a%'

Tested behavior:

  • `LIKE 'a%'` keeps `alpha`.
  • `NOT LIKE 'a%'` keeps `beta`.

BETWEEN and NOT BETWEEN

sql
SELECT input.value INTO output FROM input WHERE input.value BETWEEN 1 AND 5
SELECT value INTO output FROM input WHERE value NOT BETWEEN 1 AND 5

IN and NOT IN

sql
SELECT value INTO output FROM input WHERE value IN (1,2,3)
SELECT value INTO output FROM input WHERE value NOT IN (1,2,3)

NULL Tests

sql
SELECT value INTO output FROM input WHERE value IS NULL
SELECT value INTO output FROM input WHERE value IS NOT NULL

The tests treat a missing field as null for `IS NULL`.

Nested Conditions

Nested fields can be used in predicates:

sql
SELECT field1.field2 INTO output FROM input WHERE field1.field2 = 10

Missing or non-object nested intermediates are filtered out without throwing when they cannot satisfy the predicate.