public final class JsonUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
JsonUtil.BlockBuilderAppender |
static class |
JsonUtil.HashTable |
static interface |
JsonUtil.JsonGeneratorWriter |
static interface |
JsonUtil.ObjectKeyProvider |
| Modifier and Type | Field and Description |
|---|---|
static com.fasterxml.jackson.core.JsonFactory |
JSON_FACTORY |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canCastFromJson(Type type) |
static boolean |
canCastToJson(Type type) |
static com.fasterxml.jackson.core.JsonGenerator |
createJsonGenerator(com.fasterxml.jackson.core.JsonFactory factory,
io.airlift.slice.SliceOutput output) |
static com.fasterxml.jackson.core.JsonParser |
createJsonParser(com.fasterxml.jackson.core.JsonFactory factory,
io.airlift.slice.Slice json) |
static Long |
currentTokenAsBigint(com.fasterxml.jackson.core.JsonParser parser) |
static Boolean |
currentTokenAsBoolean(com.fasterxml.jackson.core.JsonParser parser) |
static Double |
currentTokenAsDouble(com.fasterxml.jackson.core.JsonParser parser) |
static Long |
currentTokenAsInteger(com.fasterxml.jackson.core.JsonParser parser) |
static io.airlift.slice.Slice |
currentTokenAsLongDecimal(com.fasterxml.jackson.core.JsonParser parser,
int precision,
int scale) |
static Long |
currentTokenAsReal(com.fasterxml.jackson.core.JsonParser parser) |
static Long |
currentTokenAsShortDecimal(com.fasterxml.jackson.core.JsonParser parser,
int precision,
int scale) |
static Long |
currentTokenAsSmallint(com.fasterxml.jackson.core.JsonParser parser) |
static Long |
currentTokenAsTinyint(com.fasterxml.jackson.core.JsonParser parser) |
static io.airlift.slice.Slice |
currentTokenAsVarchar(com.fasterxml.jackson.core.JsonParser parser) |
static Optional<Map<String,Integer>> |
getFieldNameToIndex(List<RowType.Field> rowFields) |
static void |
parseJsonToSingleRowBlock(com.fasterxml.jackson.core.JsonParser parser,
SingleRowBlockWriter singleRowBlockWriter,
JsonUtil.BlockBuilderAppender[] fieldAppenders,
Optional<Map<String,Integer>> fieldNameToIndex) |
static String |
truncateIfNecessaryForErrorMessage(io.airlift.slice.Slice json) |
public static com.fasterxml.jackson.core.JsonParser createJsonParser(com.fasterxml.jackson.core.JsonFactory factory,
io.airlift.slice.Slice json)
throws IOException
IOExceptionpublic static com.fasterxml.jackson.core.JsonGenerator createJsonGenerator(com.fasterxml.jackson.core.JsonFactory factory,
io.airlift.slice.SliceOutput output)
throws IOException
IOExceptionpublic static String truncateIfNecessaryForErrorMessage(io.airlift.slice.Slice json)
public static boolean canCastToJson(Type type)
public static boolean canCastFromJson(Type type)
public static io.airlift.slice.Slice currentTokenAsVarchar(com.fasterxml.jackson.core.JsonParser parser)
throws IOException
IOExceptionpublic static Long currentTokenAsBigint(com.fasterxml.jackson.core.JsonParser parser) throws IOException
IOExceptionpublic static Long currentTokenAsInteger(com.fasterxml.jackson.core.JsonParser parser) throws IOException
IOExceptionpublic static Long currentTokenAsSmallint(com.fasterxml.jackson.core.JsonParser parser) throws IOException
IOExceptionpublic static Long currentTokenAsTinyint(com.fasterxml.jackson.core.JsonParser parser) throws IOException
IOExceptionpublic static Double currentTokenAsDouble(com.fasterxml.jackson.core.JsonParser parser) throws IOException
IOExceptionpublic static Long currentTokenAsReal(com.fasterxml.jackson.core.JsonParser parser) throws IOException
IOExceptionpublic static Boolean currentTokenAsBoolean(com.fasterxml.jackson.core.JsonParser parser) throws IOException
IOExceptionpublic static Long currentTokenAsShortDecimal(com.fasterxml.jackson.core.JsonParser parser, int precision, int scale) throws IOException
IOExceptionpublic static io.airlift.slice.Slice currentTokenAsLongDecimal(com.fasterxml.jackson.core.JsonParser parser,
int precision,
int scale)
throws IOException
IOExceptionpublic static Optional<Map<String,Integer>> getFieldNameToIndex(List<RowType.Field> rowFields)
public static void parseJsonToSingleRowBlock(com.fasterxml.jackson.core.JsonParser parser,
SingleRowBlockWriter singleRowBlockWriter,
JsonUtil.BlockBuilderAppender[] fieldAppenders,
Optional<Map<String,Integer>> fieldNameToIndex)
throws IOException
IOExceptionCopyright © 2012–2019. All rights reserved.