Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
Databricks SQL
Databricks Runtime
Casts expr to TINYINT. This function is a synonym for CAST(expr AS TINYINT). See cast function for details.
Syntax
tinyint(expr)
Arguments
expr: Any expression which is castable to TINYINT.
Returns
The result is TINYINT.
If expr is a STRING that cannot be parsed as a number, Azure Databricks raises a CAST_INVALID_INPUT error. If the value overflows the TINYINT range, Azure Databricks raises a CAST_OVERFLOW error.
Common error conditions
Examples
> SELECT tinyint('12');
12
> SELECT tinyint(5.4);
5
> SELECT tinyint('abc');
Error: CAST_INVALID_INPUT