Skip to content

Transformers

Transformers modify column values before they are compared in queries or emitted in SQL. They use the pipe (|) syntax, applied left-to-right.

Apply a transformer to a column with |:

message|upper = "ERROR"

This transforms the value of message using upper before comparing with "ERROR".

Chain multiple transformers with additional pipes:

message|lower|len > 100

Transformers apply left-to-right: lower runs first (string to string), then len (string to int). The result is compared with > 100.

Each transformer declares an input type and output type. Chained transformers must be type-compatible — the output type of one must match the input type of the next.

TypeDescription
stringText values
intInteger numbers
floatFloating-point numbers
boolBoolean values
arrayArray of values (use has operator to check membership)
TransformerInputOutputDescription
upperstringstringConvert to uppercase
lowerstringstringConvert to lowercase
lenstringintGet string length
splitstringarraySplit by delimiter: split(".")

Transformers generate dialect-specific SQL function calls. Chained transformers produce nested calls (innermost first):

Single transformer: status|upper = "ERROR"

DialectGenerated SQL
ClickHouseequals(upper(status), 'ERROR')
PostgreSQLUPPER(status) = 'ERROR'
StarRocksUPPER(\status`) = ‘ERROR’`

Chained transformers: message|lower|len > 100

DialectGenerated SQL
ClickHouselength(lower(message)) > 100
PostgreSQLLENGTH(LOWER(message)) > 100
StarRocksLENGTH(LOWER(\message`)) > 100`

Split with has: message|split(" ") has "hello"

DialectGenerated SQL
ClickHousehas(splitByChar(' ', message), 'hello')
PostgreSQL'hello' = ANY(STRING_TO_ARRAY(message, ' '))
StarRocksarray_contains(SPLIT(`message`, ' '), 'hello')

If a chain has incompatible types, the editor shows an error:

message|len|upper

This fails because len outputs int, but upper requires string input. The editor displays: “len outputs int, upper requires string input”.

status|upper = "ERROR"
message|lower|len > 100
host|lower != "localhost"
path|len > 0
tags|split(",") has "urgent"

Transformers run before the alias and change the value flyql emits in SQL or matches against. Renderers run after the alias and attach display metadata without ever affecting the generated SQL or the matcher result. If you want to say “return this value uppercased”, use a transformer. If you want to say “render this column as a clickable link in my app”, use a renderer.

ConcernTransformerRenderer
Position in syntaxbefore aliasafter alias
Affects generated SQLyesno
Affects matcher outputyesno
Default registry4 built-insempty

See Renderers for the post-alias pipe syntax and Custom Renderers for the registration API.