Package io.trino.util

Class JsonUtil

java.lang.Object
io.trino.util.JsonUtil

public final class JsonUtil extends Object
  • 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

      public static String truncateIfNecessaryForErrorMessage(io.airlift.slice.Slice json)
    • canCastToJson

      public static boolean canCastToJson(Type type)
    • canCastFromJson

      public static boolean canCastFromJson(Type type)
    • 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

      public static Optional<Map<String,Integer>> getFieldNameToIndex(List<RowType.Field> rowFields)