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 TypeMethodDescriptionlong
Return the number of bytes read from the ReadChannel.protected void
Close the underlying read source.protected void
loadDictionary
(ArrowDictionaryBatch dictionaryBatch) Load an ArrowDictionaryBatch to the readers dictionary vectors.boolean
Load the next ArrowRecordBatch to the vector schema root if available.protected void
loadRecordBatch
(ArrowRecordBatch batch) Load an ArrowRecordBatch to the readers VectorSchemaRoot.protected Schema
Read 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:ArrowReader
Load an ArrowRecordBatch to the readers VectorSchemaRoot.- Overrides:
loadRecordBatch
in classArrowReader
- Parameters:
batch
- the record batch to load
-
loadDictionary
Description copied from class:ArrowReader
Load an ArrowDictionaryBatch to the readers dictionary vectors.- Overrides:
loadDictionary
in classArrowReader
- Parameters:
dictionaryBatch
- dictionary batch to load
-
loadNextBatch
Description copied from class:ArrowReader
Load the next ArrowRecordBatch to the vector schema root if available.- Specified by:
loadNextBatch
in classArrowReader
- Returns:
- true if a batch was read, false on EOS
- Throws:
IOException
- on error
-
bytesRead
public long bytesRead()Description copied from class:ArrowReader
Return the number of bytes read from the ReadChannel.- Specified by:
bytesRead
in classArrowReader
- Returns:
- number of bytes read
-
closeReadSource
Description copied from class:ArrowReader
Close the underlying read source.- Specified by:
closeReadSource
in classArrowReader
- Throws:
IOException
- on error
-
readSchema
Description copied from class:ArrowReader
Read the Schema from the source, will be invoked at the beginning the initialization.- Specified by:
readSchema
in classArrowReader
- Returns:
- the read Schema
- Throws:
IOException
- on error
-