explode_json_object
Description
explode_json_object table function, expands a JSON object into multiple rows, with each row containing a key-value pair. Typically used to expand a JSON object into a more query-friendly format. This function only supports JSON objects that contain elements. Must be used with LATERAL VIEW.
Syntax
Parameters
<json>JSON type, its content should be a JSON object.
Return Results
- Returns a single-column multi-row result set composed of all elements in
<json>, with the column type beingNullable<Struct<String, JSON>>. - If
<json>is NULL or is not a JSON object (e.g., an array[]), returns 0 rows. - If
<json>is an empty object (e.g.,{}), returns 0 rows.
