Skip to main content

TO_NULLABLE

Converts the argument type to Nullable.

Syntax

TO_NULLABLE(x);

Arguments

ArgumentsDescription
xThe original value.

Return Type

Returns the original datatype from the Nullable type; Returns the wrapped Nullable datatype for non-Nullable type.

Examples

select to_nullable(3);

+----------------+
| to_nullable(3) |
+----------------+
| 3 |
+----------------+
select to_nullable(null);

+-------------------+
| to_nullable(NULL) |
+-------------------+
| NULL |
+-------------------+