LENGTH (Lakehouse v1)
Returns the length of a given input string or binary value. In the case of strings, the length represents the count of characters, with each UTF-8 character considered as a single character. For binary data, the length corresponds to the number of bytes.
Analyze Syntax
Section titled “Analyze Syntax”func.length(<expr>)Analyze Examples
Section titled “Analyze Examples”func.length('Hello')┌──────────────────────┐│ func.length('Hello') │├──────────────────────┤│ 5 │└──────────────────────┘SQL Syntax
Section titled “SQL Syntax”LENGTH(<expr>)Aliases
Section titled “Aliases”Return Type
Section titled “Return Type”BIGINT
SQL Examples
Section titled “SQL Examples”SELECT LENGTH('Hello'), LENGTH_UTF8('Hello'), CHAR_LENGTH('Hello'), CHARACTER_LENGTH('Hello');
┌───────────────────────────────────────────────────────────────────────────────────────────┐│ length('hello') │ length_utf8('hello') │ char_length('hello') │ character_length('hello') │├─────────────────┼──────────────────────┼──────────────────────┼───────────────────────────┤│ 5 │ 5 │ 5 │ 5 │└───────────────────────────────────────────────────────────────────────────────────────────┘