T
- The type of the records returned by the reader.protected static final class AbstractOrcFileInputFormat.OrcVectorizedReader<T,BatchT> extends Object implements BulkFormat.Reader<T>
BatchT
at a time and converts it to
one or more records to be returned. An ORC Row-wise reader would convert the batch into a set
of rows, while a reader for a vectorized query processor might return the whole batch as one
record.
The conversion of the VectorizedRowBatch
happens in the specific AbstractOrcFileInputFormat.OrcReaderBatch
implementation.
The reader tracks its current position using ORC's row numbers. Each record in a batch is addressed by the starting row number of the batch, plus the number of records to be skipped before.
Modifier | Constructor and Description |
---|---|
protected |
OrcVectorizedReader(OrcShim<BatchT> shim,
org.apache.orc.RecordReader orcReader,
Pool<AbstractOrcFileInputFormat.OrcReaderBatch<T,BatchT>> pool) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the reader and should release all resources.
|
BulkFormat.RecordIterator<T> |
readBatch()
Reads one batch.
|
void |
seek(CheckpointedPosition position)
The argument of
RecordReader.seekToRow(long) must come from RecordReader.getRowNumber() . |
@Nullable public BulkFormat.RecordIterator<T> readBatch() throws IOException
BulkFormat.Reader
The returned iterator object and any contained objects may be held onto by the file source for some time, so it should not be immediately reused by the reader.
To implement reuse and to save object allocation, consider using a Pool
and recycle objects into the Pool in the
the BulkFormat.RecordIterator.releaseBatch()
method.
readBatch
in interface BulkFormat.Reader<T>
IOException
public void close() throws IOException
BulkFormat.Reader
close
in interface Closeable
close
in interface AutoCloseable
close
in interface BulkFormat.Reader<T>
IOException
public void seek(CheckpointedPosition position) throws IOException
RecordReader.seekToRow(long)
must come from RecordReader.getRowNumber()
. The internal implementation of ORC is very confusing. It
has special behavior when dealing with Predicate.IOException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.