Package org.apache.drill.exec.store.pojo
Class DynamicPojoRecordReader<T>
java.lang.Object
org.apache.drill.exec.store.AbstractRecordReader
org.apache.drill.exec.store.pojo.AbstractPojoRecordReader<List<T>>
org.apache.drill.exec.store.pojo.DynamicPojoRecordReader<T>
- Type Parameters:
T
- type of given values, if contains various types, use Object class
- All Implemented Interfaces:
AutoCloseable
,Iterable<List<T>>
,RecordReader
Dynamically reads values from the given list of records.
Creates writers based on given schema.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
An utility class that converts fromJsonNode
to DynamicPojoRecordReader during physical plan fragment deserialization. -
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
ConstructorDescriptionDynamicPojoRecordReader
(LinkedHashMap<String, Class<?>> schema, List<List<T>> records) DynamicPojoRecordReader
(LinkedHashMap<String, Class<?>> schema, List<List<T>> records, int maxRecordsToRead) -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
getFieldValue
(List<T> row, int fieldPosition) Retrieves field value to be written based for given row and field position.protected List<PojoWriter>
setupWriters
(OutputMutator output) Initiates writers based on given schema which contains field name and its type.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
-
DynamicPojoRecordReader
-
DynamicPojoRecordReader
-
-
Method Details
-
setupWriters
Initiates writers based on given schema which contains field name and its type.- Specified by:
setupWriters
in classAbstractPojoRecordReader<List<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<List<T>>
- Parameters:
row
- current rowfieldPosition
- current field position- Returns:
- field value to be written for given row
-
toString
- Overrides:
toString
in classAbstractRecordReader
-