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)

  • Field Details

  • 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)