How to read this reference
Each function entry shows:- What it does — one sentence
- Signature —
function_name(input, ...)where quoted strings are literals and bare names are columns - Example — a realistic before/after
Math
Arithmetic
Logarithms
Use these when normalizing skewed distributions or working with ML feature engineering.Rounding
String
Case & whitespace
Measurement & manipulation
Search & extract
Date & Time
Extract components
All functions take a timestamp column and return an integer.Arithmetic & formatting
Supported units for
date_add / date_diff: microsecond, millisecond, second, minute, hour, day, week, month, quarter, year
Conditional & Null
Branching
Null handling
Null checks
These return a boolean column, useful for downstream filtering or flagging.Boolean
Combine boolean columns or invert them. Inputs must be boolean type.Comparison
These produce a new boolean column. Useful for creating flag columns at the destination.Aggregate
These collapse an entire column into a single value, then broadcast it across all rows. Best used when you need to include a summary alongside row-level data (e.g. add atotal_orders column to every row in the orders table).
Statistical aggregates
Aggregate functions run over the entire batch. For grouping and partitioned aggregations, use your destination’s SQL or a transformation tool like dbt.
Window
Window functions assign a positional value to each row based on ordering. Commonly used for ranking, deduplication, and running totals.Regex
JSON
Path syntax
$.key— top-level key$.address.city— nested key$.tags[0]— first array element
Hashing & Security
Use
sha256 to pseudonymize PII before it reaches the destination. The same source value always produces the same hash, so foreign key relationships are preserved.
Type casting
Common target types:
int8, int16, int32, int64, float32, float64, utf8, bool, timestamp[us, UTC], date32
Literal values
When an argument to a function should be a fixed value rather than a column name, prefix it with=:
= prefix, the engine treats the argument as a column name.