IS_ARRAY (Lakehouse v1)
Checks if the input value is a JSON array. Please note that a JSON array is not the same as the ARRAY data type. A JSON array is a data structure commonly used in JSON, representing an ordered collection of values enclosed within square brackets [ ]. It is a flexible format for organizing and exchanging various data types, including strings, numbers, booleans, objects, and nulls.
[ "Apple", 42, true, {"name": "John", "age": 30, "isStudent": false}, [1, 2, 3], null]Analyze Syntax
Section titled “Analyze Syntax”func.is_array(<expr>)Analyze Examples
Section titled “Analyze Examples”func.is_array(func.parse_json('true')), func.is_array(func.parse_json('[1,2,3]'))┌────────────────────────────────────────────────────────────────────────────────────┐│ func.is_array(func.parse_json('true')) │ func.is_array(func.parse_json('[1,2,3]')) │├────────────────────────────────────────┼───────────────────────────────────────────┤│ false │ true │└────────────────────────────────────────────────────────────────────────────────────┘SQL Syntax
Section titled “SQL Syntax”IS_ARRAY( <expr> )Return Type
Section titled “Return Type”Returns true if the input value is a JSON array, and false otherwise.
SQL Examples
Section titled “SQL Examples”SELECT IS_ARRAY(PARSE_JSON('true')), IS_ARRAY(PARSE_JSON('[1,2,3]'));
┌────────────────────────────────────────────────────────────────┐│ is_array(parse_json('true')) │ is_array(parse_json('[1,2,3]')) │├──────────────────────────────┼─────────────────────────────────┤│ false │ true │└────────────────────────────────────────────────────────────────┘