Utility Functions
General-purpose functions for data manipulation, control flow, and type handling.
Parenthetical
Used for explicit grouping of expressions, primarily to control the order of operations. Does not change the value, type, or purpose of the enclosed expression.
Coalesce
Returns the first non-null value from its list of arguments. All arguments must be of compatible types. Returns NULL if all arguments are NULL.
Cast
Explicitly converts an expression to a target data type specified as the second argument. Idiomatic shorthand is <expr>::<type>, though cast(a, b) work as well.
IS_NULL
Returns true if the input argument is NULL, false otherwise.
BOOL
Attempts to convert the input argument to a boolean value. Behavior depends on the input type (e.g., 0 -> false, non-zero -> true; empty string -> false, non-empty -> true).
CASE
Evaluates a series of conditions and returns a result based on the first condition that evaluates to true. Syntax: `CASE WHEN condition1 THEN result1 [WHEN condition2 THEN result2 ...] [ELSE default_result] END`. All result expressions must have compatible types.
NULLIF
Returns NULL if the two arguments are equal, otherwise it returns the first argument.
UNION
Combines the ranges of two or more concepts into a new concept.
HASH
Computes a hash of the given string using a specified algorithm (e.g., 'md5', 'sha1', 'sha256').
GEO_POINT
Creates a geographical point from latitude and longitude values.
GEO_DISTANCE
Calculates the distance between two geographical points, typically in meters.
