boolean function (Databricks SQL)

Casts expr to boolean.

Syntax

boolean(expr)

Arguments

  • expr: Any expression that can be cast to BOOLEAN.

Returns

A BOOLEAN.

This function is a synonym for CAST(expr AS binary).

See cast function (Databricks SQL) for details.

Examples

> SELECT boolean(1);
 true
> SELECT boolean(0);
 false

> SELECT boolean(2);
 true