string function

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime

Casts the value expr to STRING.

Syntax

string(expr)

Arguments

  • expr: An expression that can be cast to STRING.

Returns

The result matches the type of expr.

This function is a synonym for cast(expr AS STRING)

See cast function for details.

Examples

> SELECT string(5);
 5
> SELECT string(current_date);
 2021-04-01