raise_error function (Databricks SQL)

Throws an exception with expr as the message.

Syntax

raise_error(expr)

Arguments

  • expr: A STRING expression.

Returns

The NULL type.

The function raises a runtime error with expr as the error message.

Examples

> SELECT raise_error('custom error message');
 custom error message