assert_true function (Databricks SQL)

Returns an error if expr is not true.

Syntax

assert_true(expr)

Arguments

  • expr: A BOOLEAN expression.

Returns

An untyped NULL if no error is returned.

Examples

> SELECT assert_true(0 < 1);
 NULL
> SELECT assert_true(0 > 1);
 '0 > 1' is not true