character_length
function
Applies to: Databricks SQL Databricks Runtime
Returns the character length of string data or number of bytes of binary data. This function is a synonym for char_length function and length function.
Syntax
character_length(expr)
Arguments
expr
: A BINARY or STRING expression.
Returns
The result type is INTEGER.
The length of string data includes the trailing spaces. The length of binary data includes binary zeros.
Examples
> SELECT character_length('Spark SQL ');
10
> select character_length('床前明月光')
5
Related functions
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for