Package org.apache.flink.orc
Class OrcSplitReader<T,BATCH>
java.lang.Object
org.apache.flink.orc.OrcSplitReader<T,BATCH>
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
OrcColumnarRowSplitReader
Orc split reader to read record from orc file. The reader is only responsible for reading the
data of a single split.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOrcSplitReader(OrcShim<BATCH> shim, org.apache.hadoop.conf.Configuration conf, org.apache.orc.TypeDescription schema, int[] selectedFields, List<OrcFilters.Predicate> conjunctPredicates, int batchSize, org.apache.flink.core.fs.Path path, long splitStart, long splitLength) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected abstract intfillRows()Fills an ORC batch into an array of Row.org.apache.orc.RecordReaderabstract TnextRecord(T reuse) Reads the next record from the input.booleanMethod used to check if the end of the input is reached.voidseekToRow(long rowCount) Seek to a particular row number.
-
Field Details
-
rowBatchWrapper
-
nextRow
protected int nextRow
-
-
Constructor Details
-
OrcSplitReader
public OrcSplitReader(OrcShim<BATCH> shim, org.apache.hadoop.conf.Configuration conf, org.apache.orc.TypeDescription schema, int[] selectedFields, List<OrcFilters.Predicate> conjunctPredicates, int batchSize, org.apache.flink.core.fs.Path path, long splitStart, long splitLength) throws IOException - Throws:
IOException
-
-
Method Details
-
seekToRow
Seek to a particular row number.- Throws:
IOException
-
getRecordReader
@VisibleForTesting public org.apache.orc.RecordReader getRecordReader() -
reachedEnd
Method used to check if the end of the input is reached.- Returns:
- True if the end is reached, otherwise false.
- Throws:
IOException- Thrown, if an I/O error occurred.
-
fillRows
protected abstract int fillRows()Fills an ORC batch into an array of Row.- Returns:
- The number of rows that were filled.
-
nextRecord
Reads the next record from the input.- Parameters:
reuse- Object that may be reused.- Returns:
- Read record.
- Throws:
IOException- Thrown, if an I/O error occurred.
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-