Transforms

Transforms are functions that take a relation and produce a relation.

Usually they are chained together into a pipeline, which resembles an SQL query.

Transforms were designed with a focus on modularity, so each of them is fulfilling a specific purpose and has defined invariants (properties of the relation that are left unaffected). That’s often referred to as “orthogonality” and is key to keep the number of transforms low.

These are the currently available transforms:

TransformPurposeSQL Equivalent
fromStart from a tableFROM
deriveCompute new columnsSELECT *, … AS …
selectPick & compute columnsSELECT … AS …
filterPick rows based on their valuesWHERE, HAVING,QUALIFY
sortOrder rows based on the values of columnsORDER BY
joinAdd columns from another table, matching rows based on a conditionJOIN
takePick rows based on their positionTOP, LIMIT, OFFSET
groupPartition rows into groups and applies a pipeline to each of themGROUP BY, PARTITION BY
aggregateSummarize many rows into one rowSELECT foo(…)
windowApply a pipeline to overlapping segments of rowsOVER, ROWS, RANGE