get_json_object function

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime

Extracts a JSON object from path.

Syntax

get_json_object(expr, path)

Arguments

  • expr: A STRING expression containing well formed JSON.

  • path: A STRING literal with a well formed JSON path.

Returns

A STRING.

If the object cannot be found null is returned.

Examples

> SELECT get_json_object('{"a":"b"}', '$.a');
 b