Package org.apache.drill.exec.store.pojo
Class PojoRecordReader<T>
java.lang.Object
org.apache.drill.exec.store.AbstractRecordReader
org.apache.drill.exec.store.pojo.AbstractPojoRecordReader<T>
org.apache.drill.exec.store.pojo.PojoRecordReader<T>
- Type Parameters:
T
- pojo class type
- All Implemented Interfaces:
AutoCloseable
,Iterable<T>
,RecordReader
Reads values from the given list of pojo instances.
Fields writers are determined based on pojo field class types.
-
Field Summary
Fields inherited from class org.apache.drill.exec.store.pojo.AbstractPojoRecordReader
DEFAULT_RECORDS_PER_BATCH, records, writers
Fields inherited from class org.apache.drill.exec.store.AbstractRecordReader
DEFAULT_TEXT_COLS_TO_READ
Fields inherited from interface org.apache.drill.exec.store.RecordReader
ALLOCATOR_INITIAL_RESERVATION, ALLOCATOR_MAX_RESERVATION
-
Constructor Summary
ConstructorDescriptionPojoRecordReader
(Class<T> pojoClass, List<T> records) PojoRecordReader
(Class<T> pojoClass, List<T> records, int maxRecordToRead) -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
getFieldValue
(T row, int fieldPosition) Retrieves field value to be written based for given row and field position.protected List<PojoWriter>
setupWriters
(OutputMutator output) Creates writers based on pojo field class types.toString()
Methods inherited from class org.apache.drill.exec.store.pojo.AbstractPojoRecordReader
allocate, close, initWriter, iterator, next, setup
Methods inherited from class org.apache.drill.exec.store.AbstractRecordReader
getColumns, getDefaultColumnsToRead, hasNext, isSkipQuery, isStarQuery, setColumns, transformColumns
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
PojoRecordReader
-
PojoRecordReader
-
-
Method Details
-
setupWriters
Creates writers based on pojo field class types. Ignores static fields.- Specified by:
setupWriters
in classAbstractPojoRecordReader<T>
- Parameters:
output
- output mutator- Returns:
- list of pojo writers
- Throws:
ExecutionSetupException
-
getFieldValue
Description copied from class:AbstractPojoRecordReader
Retrieves field value to be written based for given row and field position.- Specified by:
getFieldValue
in classAbstractPojoRecordReader<T>
- Parameters:
row
- current rowfieldPosition
- current field position- Returns:
- field value to be written for given row
-
toString
- Overrides:
toString
in classAbstractRecordReader
-