java.lang.Object
org.apache.arrow.vector.ipc.ArrowReader
org.apache.arrow.vector.ipc.ArrowFileReader
- All Implemented Interfaces:
AutoCloseable,DictionaryProvider
An implementation of
ArrowReader that reads the standard arrow binary file format.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.arrow.vector.dictionary.DictionaryProvider
DictionaryProvider.MapDictionaryProvider -
Field Summary
Fields inherited from class org.apache.arrow.vector.ipc.ArrowReader
allocator, dictionaries -
Constructor Summary
ConstructorsConstructorDescriptionArrowFileReader(SeekableByteChannel in, BufferAllocator allocator) ArrowFileReader(SeekableByteChannel in, BufferAllocator allocator, CompressionCodec.Factory compressionFactory) ArrowFileReader(SeekableReadChannel in, BufferAllocator allocator) ArrowFileReader(SeekableReadChannel in, BufferAllocator allocator, CompressionCodec.Factory compressionFactory) -
Method Summary
Modifier and TypeMethodDescriptionlongReturn the number of bytes read from the ReadChannel.protected voidClose the underlying read source.Get custom metadata.Returns theArrowBlockmetadata from the file.voidReads the schema and initializes the vectors.booleanReturns true if a batch was read, false if no more batches.booleanloadRecordBatch(ArrowBlock block) Loads record batch for the given block.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 SchemaRead the Schema from the source, will be invoked at the beginning the initialization.Methods inherited from class org.apache.arrow.vector.ipc.ArrowReader
close, close, ensureInitialized, getDictionaryIds, getDictionaryVectors, getVectorSchemaRoot, loadDictionary, loadRecordBatch, lookup, prepareLoadNextBatch
-
Constructor Details
-
ArrowFileReader
public ArrowFileReader(SeekableReadChannel in, BufferAllocator allocator, CompressionCodec.Factory compressionFactory) -
ArrowFileReader
public ArrowFileReader(SeekableByteChannel in, BufferAllocator allocator, CompressionCodec.Factory compressionFactory) -
ArrowFileReader
-
ArrowFileReader
-
-
Method Details
-
bytesRead
public long bytesRead()Description copied from class:ArrowReaderReturn the number of bytes read from the ReadChannel.- Specified by:
bytesReadin classArrowReader- Returns:
- number of bytes read
-
closeReadSource
Description copied from class:ArrowReaderClose the underlying read source.- Specified by:
closeReadSourcein classArrowReader- Throws:
IOException- on error
-
readSchema
Description copied from class:ArrowReaderRead the Schema from the source, will be invoked at the beginning the initialization.- Specified by:
readSchemain classArrowReader- Returns:
- the read Schema
- Throws:
IOException- on error
-
initialize
Description copied from class:ArrowReaderReads the schema and initializes the vectors.- Overrides:
initializein classArrowReader- Throws:
IOException
-
getMetaData
Get custom metadata. -
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.- Returns:
- the read ArrowDictionaryBatch
- Throws:
IOException- on error
-
loadNextBatch
Returns true if a batch was read, false if no more batches.- Specified by:
loadNextBatchin classArrowReader- Returns:
- true if a batch was read, false on EOS
- Throws:
IOException- on error
-
getDictionaryBlocks
- Throws:
IOException
-
getRecordBlocks
Returns theArrowBlockmetadata from the file.- Throws:
IOException
-
loadRecordBatch
Loads record batch for the given block.- Throws:
IOException
-