java.lang.Object
org.apache.arrow.vector.ipc.ArrowReader
org.apache.arrow.dataset.scanner.ArrowScannerReader
- All Implemented Interfaces:
AutoCloseable,DictionaryProvider
An implementation of
ArrowReader that reads the dataset from Scanner.-
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
ConstructorsConstructorDescriptionArrowScannerReader(Scanner scanner, BufferAllocator allocator) Constructs a scanner reader using a Scanner. -
Method Summary
Modifier and TypeMethodDescriptionlongReturn the number of bytes read from the ReadChannel.protected voidClose the underlying read source.protected voidloadDictionary(ArrowDictionaryBatch dictionaryBatch) Load an ArrowDictionaryBatch to the readers dictionary vectors.booleanLoad the next ArrowRecordBatch to the vector schema root if available.protected voidloadRecordBatch(ArrowRecordBatch batch) Load an ArrowRecordBatch to the readers VectorSchemaRoot.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, initialize, lookup, prepareLoadNextBatch
-
Constructor Details
-
ArrowScannerReader
Constructs a scanner reader using a Scanner.- Parameters:
scanner- scanning data over datasetallocator- to allocate new buffers
-
-
Method Details
-
loadRecordBatch
Description copied from class:ArrowReaderLoad an ArrowRecordBatch to the readers VectorSchemaRoot.- Overrides:
loadRecordBatchin classArrowReader- Parameters:
batch- the record batch to load
-
loadDictionary
Description copied from class:ArrowReaderLoad an ArrowDictionaryBatch to the readers dictionary vectors.- Overrides:
loadDictionaryin classArrowReader- Parameters:
dictionaryBatch- dictionary batch to load
-
loadNextBatch
Description copied from class:ArrowReaderLoad the next ArrowRecordBatch to the vector schema root if available.- Specified by:
loadNextBatchin classArrowReader- Returns:
- true if a batch was read, false on EOS
- Throws:
IOException- on error
-
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
-