public class JsonFileReader extends Object implements AutoCloseable, DictionaryProvider
This class uses a streaming parser API, method naming tends to reflect this implementation detail.
DictionaryProvider.MapDictionaryProvider| Constructor and Description |
|---|
JsonFileReader(File inputFile,
BufferAllocator allocator)
Constructs a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Dictionary |
lookup(long id)
Return the dictionary for the given ID.
|
VectorSchemaRoot |
read()
Returns the next record batch from the file.
|
boolean |
read(VectorSchemaRoot root)
Reads the next record batch from the file into
root. |
Schema |
start()
Reads the beginning (schema section) of the json file and returns it.
|
public JsonFileReader(File inputFile, BufferAllocator allocator) throws com.fasterxml.jackson.core.JsonParseException, IOException
inputFile - The file to read.allocator - The allocator to use for allocating buffers.com.fasterxml.jackson.core.JsonParseExceptionIOExceptionpublic Dictionary lookup(long id)
DictionaryProviderlookup in interface DictionaryProviderpublic Schema start() throws com.fasterxml.jackson.core.JsonParseException, IOException
com.fasterxml.jackson.core.JsonParseExceptionIOExceptionpublic boolean read(VectorSchemaRoot root) throws IOException
root.IOExceptionpublic VectorSchemaRoot read() throws IOException
IOExceptionpublic void close()
throws IOException
close in interface AutoCloseableIOExceptionCopyright © 2021 The Apache Software Foundation. All rights reserved.