Class JsonInputFunctions

java.lang.Object
io.trino.operator.scalar.json.JsonInputFunctions

public final class JsonInputFunctions extends Object
Read string input as JSON.

These functions are used by JSON_EXISTS, JSON_VALUE and JSON_QUERY functions for parsing the JSON input arguments and applicable JSON path parameters.

If the error handling strategy of the enclosing JSON function is ERROR ON ERROR, these input functions throw exception in case of parse error. Otherwise, the parse error is suppressed, and a marker value JSON_ERROR is returned, so that the enclosing function can handle the error accordingly to its error handling strategy (e.g. return a default value).

A duplicate key in a JSON object does not cause error. The resulting object has one entry with that key, chosen arbitrarily. This behavior fulfills the 'WITHOUT UNIQUE KEYS' option. (SQL standard p. 692)