Package org.apache.flink.orc
Class AbstractOrcFileInputFormat.OrcReaderBatch<T,BatchT>
java.lang.Object
org.apache.flink.orc.AbstractOrcFileInputFormat.OrcReaderBatch<T,BatchT>
- Enclosing class:
- AbstractOrcFileInputFormat<T,
BatchT, SplitT extends org.apache.flink.connector.file.src.FileSourceSplit>
The
OrcReaderBatch class holds the data structures containing the batch data (column
vectors, row arrays, ...) and performs the batch conversion from the ORC representation to
the result format.
This base class only holds the ORC Column Vectors, subclasses hold additionally the result
structures and implement the conversion in convertAndGetIterator(OrcVectorizedBatchWrapper, long).
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOrcReaderBatch(OrcVectorizedBatchWrapper<BatchT> orcVectorizedRowBatch, org.apache.flink.connector.file.src.util.Pool.Recycler<AbstractOrcFileInputFormat.OrcReaderBatch<T, BatchT>> recycler) -
Method Summary
Modifier and TypeMethodDescriptionabstract org.apache.flink.connector.file.src.reader.BulkFormat.RecordIterator<T>convertAndGetIterator(OrcVectorizedBatchWrapper<BatchT> orcVectorizedRowBatch, long startingOffset) Converts the ORC VectorizedRowBatch into the result structure and returns an iterator over the entries.Gets the ORC VectorizedRowBatch structure from this batch.voidrecycle()Puts this batch back into the pool.
-
Constructor Details
-
OrcReaderBatch
protected OrcReaderBatch(OrcVectorizedBatchWrapper<BatchT> orcVectorizedRowBatch, org.apache.flink.connector.file.src.util.Pool.Recycler<AbstractOrcFileInputFormat.OrcReaderBatch<T, BatchT>> recycler)
-
-
Method Details
-
recycle
public void recycle()Puts this batch back into the pool. This should be called after all records from the batch have been returned, typically in theBulkFormat.RecordIterator.releaseBatch()method. -
orcVectorizedRowBatch
Gets the ORC VectorizedRowBatch structure from this batch. -
convertAndGetIterator
public abstract org.apache.flink.connector.file.src.reader.BulkFormat.RecordIterator<T> convertAndGetIterator(OrcVectorizedBatchWrapper<BatchT> orcVectorizedRowBatch, long startingOffset) throws IOException Converts the ORC VectorizedRowBatch into the result structure and returns an iterator over the entries.This method may, for example, return a single element iterator that returns the entire batch as one, or (as another example) return an iterator over the rows projected from this column batch.
The position information in the result needs to be constructed as follows: The value of
startingOffsetis the offset value (RecordAndPosition.getOffset()) for all rows in the batch. Each row then increments the records-to-skip value (RecordAndPosition.getRecordSkipCount()).- Throws:
IOException
-