Package org.apache.drill.exec.record
Class RecordBatchLoader
java.lang.Object
org.apache.drill.exec.record.RecordBatchLoader
- All Implemented Interfaces:
Iterable<VectorWrapper<?>>,VectorAccessible
Holds record batch loaded from record batch message.
-
Constructor Summary
ConstructorsConstructorDescriptionRecordBatchLoader(BufferAllocator allocator) Constructs a loader using the given allocator for vector buffer allocation. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears this loader, which clears the internal vector container (seeVectorContainer.clear()) and resets the record count to zero.intGet the number of records.Get the schema of the current RecordBatch.getValueAccessorById(Class<?> clazz, int... ids) getValueVectorId(SchemaPath path) Get the value vector type and id for the given schema path.iterator()booleanload(UserBitShared.RecordBatchDef def, DrillBuf buf) Load a record batch from a single buffer.voidtoString()voidzero()Removes an data from the loader, but maintains the schema and empty vectors.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
RecordBatchLoader
Constructs a loader using the given allocator for vector buffer allocation.
-
-
Method Details
-
allocator
-
getValueVectorId
Description copied from interface:VectorAccessibleGet the value vector type and id for the given schema path. The TypedFieldId should store a fieldId which is the same as the ordinal position of the field within the Iterator provided this classes implementation ofIterable<ValueVector>.- Specified by:
getValueVectorIdin interfaceVectorAccessible- Parameters:
path- the path where the vector should be located.- Returns:
- the local field id associated with this vector. If no field matches this path, this will return a null TypedFieldId
-
getRecordCount
public int getRecordCount()Description copied from interface:VectorAccessibleGet the number of records.- Specified by:
getRecordCountin interfaceVectorAccessible- Returns:
- number of records
-
getContainer
-
getValueAccessorById
- Specified by:
getValueAccessorByIdin interfaceVectorAccessible
-
getWritableBatch
-
iterator
- Specified by:
iteratorin interfaceIterable<VectorWrapper<?>>
-
getSelectionVector2
- Specified by:
getSelectionVector2in interfaceVectorAccessible
-
getSelectionVector4
- Specified by:
getSelectionVector4in interfaceVectorAccessible
-
getSchema
Description copied from interface:VectorAccessibleGet the schema of the current RecordBatch. This changes if and only if a *_NEW_SCHEMA IterOutcome is provided.- Specified by:
getSchemain interfaceVectorAccessible- Returns:
- schema of the current batch
-
resetRecordCount
public void resetRecordCount() -
zero
public void zero()Removes an data from the loader, but maintains the schema and empty vectors. -
clear
public void clear()Clears this loader, which clears the internal vector container (seeVectorContainer.clear()) and resets the record count to zero. -
toString
-