JSON_LENGTH (Lakehouse v2)
Returns the number of elements in a JSON object or array.
Analyze Syntax
Section titled “Analyze Syntax”func.json_length(get_column(table, 'data'))Analyze Examples
Section titled “Analyze Examples”func.json_length(get_column(table, 'data'))
┌───┐│ 2 │└───┘SQL Syntax
Section titled “SQL Syntax”JSON_LENGTH(<data>)SQL Examples
Section titled “SQL Examples”SELECT JSON_LENGTH(PARSE_JSON('{"name":"Alice","age":30}'));
┌───┐│ 2 │└───┘