Class JsonType


public class JsonType extends ArrowType.ExtensionType
Canonical extension type for UTF-8 encoded RFC 8259 JSON values.

The storage type is ArrowType.Utf8, ArrowType.LargeUtf8, or ArrowType.Utf8View. Values use the corresponding string vector; this type does not parse or validate individual JSON values.

Register the type before reading schemas containing arrow.json:

JsonType.ensureRegistered();
Field field = Field.nullable("json", new JsonType(ArrowType.Utf8.INSTANCE));
try (JsonVector vector = (JsonVector) field.createVector(allocator)) {
  VarCharVector storage = (VarCharVector) vector.getUnderlyingVector();
  storage.setSafe(0, "{}".getBytes(java.nio.charset.StandardCharsets.UTF_8));
  vector.setValueCount(1);
  Text value = vector.getObject(0);
}