Skip to content

COALESCE and NULLIF

COALESCE(a, b, ...) returns the first non-null argument. NULLIF(a, b) returns null when a equals b, otherwise a. Arguments must have compatible types.

RETURN COALESCE(NULL, 'fallback') AS value,
NULLIF('deleted', 'deleted') AS missing;

Both functions execute through DataFusion. Null-only inputs retain a null type until context supplies a concrete family. Unlike these case abbreviations, general CASE expressions are currently syntax only.