Package io.trino.operator.scalar.json
Class JsonInputFunctions
java.lang.Object
io.trino.operator.scalar.json.JsonInputFunctions
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)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic com.fasterxml.jackson.databind.JsonNodevarbinaryToJson(io.airlift.slice.Slice inputExpression, boolean failOnError) static com.fasterxml.jackson.databind.JsonNodevarbinaryUtf16ToJson(io.airlift.slice.Slice inputExpression, boolean failOnError) static com.fasterxml.jackson.databind.JsonNodevarbinaryUtf32ToJson(io.airlift.slice.Slice inputExpression, boolean failOnError) static com.fasterxml.jackson.databind.JsonNodevarbinaryUtf8ToJson(io.airlift.slice.Slice inputExpression, boolean failOnError) static com.fasterxml.jackson.databind.JsonNodevarcharToJson(io.airlift.slice.Slice inputExpression, boolean failOnError)
-
Field Details
-
VARCHAR_TO_JSON
- See Also:
-
VARBINARY_TO_JSON
- See Also:
-
VARBINARY_UTF8_TO_JSON
- See Also:
-
VARBINARY_UTF16_TO_JSON
- See Also:
-
VARBINARY_UTF32_TO_JSON
- See Also:
-
-
Method Details
-
varcharToJson
public static com.fasterxml.jackson.databind.JsonNode varcharToJson(io.airlift.slice.Slice inputExpression, boolean failOnError) -
varbinaryToJson
public static com.fasterxml.jackson.databind.JsonNode varbinaryToJson(io.airlift.slice.Slice inputExpression, boolean failOnError) -
varbinaryUtf8ToJson
public static com.fasterxml.jackson.databind.JsonNode varbinaryUtf8ToJson(io.airlift.slice.Slice inputExpression, boolean failOnError) -
varbinaryUtf16ToJson
public static com.fasterxml.jackson.databind.JsonNode varbinaryUtf16ToJson(io.airlift.slice.Slice inputExpression, boolean failOnError) -
varbinaryUtf32ToJson
public static com.fasterxml.jackson.databind.JsonNode varbinaryUtf32ToJson(io.airlift.slice.Slice inputExpression, boolean failOnError)
-