java.lang.Object
org.apache.arrow.adapter.orc.OrcReader
- All Implemented Interfaces:
AutoCloseable
Orc Reader that allow accessing orc stripes in Orc file. This orc reader basically acts like an
ArrowReader iterator that iterate over orc stripes. Each stripe will be accessed via an
ArrowReader.
-
Constructor Summary
ConstructorsConstructorDescriptionOrcReader
(String filePath, BufferAllocator allocator) Create an OrcReader that iterate over orc stripes. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
int
The number of stripes in the file.nextStripeReader
(long batchSize) Get a stripe level ArrowReader with specified batchSize in each record batch.boolean
seek
(int rowNumber) Seek to designated row.
-
Constructor Details
-
OrcReader
public OrcReader(String filePath, BufferAllocator allocator) throws IOException, IllegalAccessException Create an OrcReader that iterate over orc stripes.- Parameters:
filePath
- file path to target file, currently only support local file.allocator
- allocator provided to ArrowReader.- Throws:
IOException
- throws exception in case of file not foundIllegalAccessException
-
-
Method Details
-
seek
Seek to designated row. Invoke NextStripeReader() after seek will return stripe reader starting from designated row.- Parameters:
rowNumber
- the rows number to seek- Returns:
- true if seek operation is succeeded
- Throws:
IllegalArgumentException
-
nextStripeReader
Get a stripe level ArrowReader with specified batchSize in each record batch.- Parameters:
batchSize
- the number of rows loaded on each iteration- Returns:
- ArrowReader that iterate over current stripes
- Throws:
IllegalArgumentException
-
getNumberOfStripes
The number of stripes in the file.- Returns:
- number of stripes
- Throws:
IllegalArgumentException
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-