All Products
Search
Document Center

MaxCompute:JSON functions

Last Updated:Oct 23, 2025

MaxCompute supports four complex data types: ARRAY, MAP, STRUCT, and JSON. This topic describes JSON functions and their features.

For information about the limits of JSON functions, see Limits.

Function

Description

FROM_JSON

Returns an ARRAY, MAP, or STRUCT type from a JSON string based on the specified output format.

GET_JSON_OBJECT

Extracts a string from a JSON string using a specified path.

JSON_INSERT

Inserts a JSON value at a specified position in a JSON document.

JSON_OBJECT

Generates a JSON object from key-value pairs.

JSON_ARRAY

Creates a JSON array from a list of values. The list can be empty.

JSON_EXPLODE

Expands each element in a JSON array or JSON object into multiple rows.

JSON_EXTRACT

Extracts data from a JSON string or JSON data type based on a specified JSONPath.

JSON_EXISTS

Checks whether a specified JSONPath exists in a JSON document.

JSON_PRETTY

Formats a JSON string for readability by adding line breaks and spaces.

JSON_TYPE

Returns the type name of a JSON value.

JSON_FORMAT

Converts a JSON data type to a string. The output is not prettified by default.

JSON_PARSE

Converts a string to a JSON data type. An error is returned if the string is not in valid JSON format.

JSON_SET

Replaces an existing value or adds a new value at a specified path in a JSON document.

JSON_STRIP_NULLS

Removes all fields or elements with a value of null from a JSON object or JSON array.

JSON_VALID

Checks whether a string is valid JSON.

JSON_TUPLE

Extracts the values of multiple keys from a JSON string and returns them as a tuple of strings.

TO_JSON

Converts a specified complex data type to a JSON string.