public class ArrowFileReader extends ArrowReader
ArrowReader
that reads the standard arrow binary
file format.DictionaryProvider.MapDictionaryProvider
allocator, dictionaries
Constructor and Description |
---|
ArrowFileReader(SeekableByteChannel in,
BufferAllocator allocator) |
ArrowFileReader(SeekableReadChannel in,
BufferAllocator allocator) |
Modifier and Type | Method and Description |
---|---|
long |
bytesRead()
Return the number of bytes read from the ReadChannel.
|
protected void |
closeReadSource()
Close the underlying read source.
|
List<ArrowBlock> |
getDictionaryBlocks() |
Map<String,String> |
getMetaData()
Get custom metadata.
|
List<ArrowBlock> |
getRecordBlocks()
Returns the
ArrowBlock metadata from the file. |
void |
initialize()
Reads the schema and initializes the vectors.
|
boolean |
loadNextBatch()
Returns true if a batch was read, false if no more batches.
|
boolean |
loadRecordBatch(ArrowBlock block)
Loads record batch for the given block.
|
ArrowDictionaryBatch |
readDictionary()
Read a dictionary batch from the source, will be invoked after the schema has been read and
called N times, where N is the number of dictionaries indicated by the schema Fields.
|
protected Schema |
readSchema()
Read the Schema from the source, will be invoked at the beginning the initialization.
|
close, close, ensureInitialized, getDictionaryVectors, getVectorSchemaRoot, loadDictionary, loadRecordBatch, lookup, prepareLoadNextBatch
public ArrowFileReader(SeekableReadChannel in, BufferAllocator allocator)
public ArrowFileReader(SeekableByteChannel in, BufferAllocator allocator)
public long bytesRead()
ArrowReader
bytesRead
in class ArrowReader
protected void closeReadSource() throws IOException
ArrowReader
closeReadSource
in class ArrowReader
IOException
- on errorprotected Schema readSchema() throws IOException
ArrowReader
readSchema
in class ArrowReader
IOException
- on errorpublic void initialize() throws IOException
ArrowReader
initialize
in class ArrowReader
IOException
public ArrowDictionaryBatch readDictionary() throws IOException
IOException
- on errorpublic boolean loadNextBatch() throws IOException
loadNextBatch
in class ArrowReader
IOException
- on errorpublic List<ArrowBlock> getDictionaryBlocks() throws IOException
IOException
public List<ArrowBlock> getRecordBlocks() throws IOException
ArrowBlock
metadata from the file.IOException
public boolean loadRecordBatch(ArrowBlock block) throws IOException
IOException
Copyright © 2020 The Apache Software Foundation. All rights reserved.