Package io.trino.util
Class JsonUtil
java.lang.Object
io.trino.util.JsonUtil
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfacestatic interface -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanCastFromJson(Type type) static booleancanCastToJson(Type type) static com.fasterxml.jackson.core.JsonFactorystatic com.fasterxml.jackson.core.JsonGeneratorcreateJsonGenerator(com.fasterxml.jackson.core.JsonFactory factory, io.airlift.slice.SliceOutput output) static com.fasterxml.jackson.core.JsonParsercreateJsonParser(com.fasterxml.jackson.core.JsonFactory factory, io.airlift.slice.Slice json) static LongcurrentTokenAsBigint(com.fasterxml.jackson.core.JsonParser parser) static BooleancurrentTokenAsBoolean(com.fasterxml.jackson.core.JsonParser parser) static DoublecurrentTokenAsDouble(com.fasterxml.jackson.core.JsonParser parser) static LongcurrentTokenAsInteger(com.fasterxml.jackson.core.JsonParser parser) static Int128currentTokenAsLongDecimal(com.fasterxml.jackson.core.JsonParser parser, int precision, int scale) static LongcurrentTokenAsReal(com.fasterxml.jackson.core.JsonParser parser) static LongcurrentTokenAsShortDecimal(com.fasterxml.jackson.core.JsonParser parser, int precision, int scale) static LongcurrentTokenAsSmallint(com.fasterxml.jackson.core.JsonParser parser) static LongcurrentTokenAsTinyint(com.fasterxml.jackson.core.JsonParser parser) static io.airlift.slice.SlicecurrentTokenAsVarchar(com.fasterxml.jackson.core.JsonParser parser) getFieldNameToIndex(List<RowType.Field> rowFields) static StringtruncateIfNecessaryForErrorMessage(io.airlift.slice.Slice json)
-
Method Details
-
createJsonFactory
public static com.fasterxml.jackson.core.JsonFactory createJsonFactory() -
createJsonParser
public static com.fasterxml.jackson.core.JsonParser createJsonParser(com.fasterxml.jackson.core.JsonFactory factory, io.airlift.slice.Slice json) throws IOException - Throws:
IOException
-
createJsonGenerator
public static com.fasterxml.jackson.core.JsonGenerator createJsonGenerator(com.fasterxml.jackson.core.JsonFactory factory, io.airlift.slice.SliceOutput output) throws IOException - Throws:
IOException
-
truncateIfNecessaryForErrorMessage
-
canCastToJson
-
canCastFromJson
-
currentTokenAsVarchar
public static io.airlift.slice.Slice currentTokenAsVarchar(com.fasterxml.jackson.core.JsonParser parser) throws IOException - Throws:
IOException
-
currentTokenAsBigint
public static Long currentTokenAsBigint(com.fasterxml.jackson.core.JsonParser parser) throws IOException - Throws:
IOException
-
currentTokenAsInteger
public static Long currentTokenAsInteger(com.fasterxml.jackson.core.JsonParser parser) throws IOException - Throws:
IOException
-
currentTokenAsSmallint
public static Long currentTokenAsSmallint(com.fasterxml.jackson.core.JsonParser parser) throws IOException - Throws:
IOException
-
currentTokenAsTinyint
public static Long currentTokenAsTinyint(com.fasterxml.jackson.core.JsonParser parser) throws IOException - Throws:
IOException
-
currentTokenAsDouble
public static Double currentTokenAsDouble(com.fasterxml.jackson.core.JsonParser parser) throws IOException - Throws:
IOException
-
currentTokenAsReal
public static Long currentTokenAsReal(com.fasterxml.jackson.core.JsonParser parser) throws IOException - Throws:
IOException
-
currentTokenAsBoolean
public static Boolean currentTokenAsBoolean(com.fasterxml.jackson.core.JsonParser parser) throws IOException - Throws:
IOException
-
currentTokenAsShortDecimal
public static Long currentTokenAsShortDecimal(com.fasterxml.jackson.core.JsonParser parser, int precision, int scale) throws IOException - Throws:
IOException
-
currentTokenAsLongDecimal
public static Int128 currentTokenAsLongDecimal(com.fasterxml.jackson.core.JsonParser parser, int precision, int scale) throws IOException - Throws:
IOException
-
getFieldNameToIndex
-