Class ProjectRecordBatch
java.lang.Object
org.apache.drill.exec.record.AbstractRecordBatch<Project>
org.apache.drill.exec.record.AbstractUnaryRecordBatch<Project>
org.apache.drill.exec.record.AbstractSingleRecordBatch<Project>
org.apache.drill.exec.physical.impl.project.ProjectRecordBatch
- All Implemented Interfaces:
AutoCloseable,Iterable<VectorWrapper<?>>,CloseableRecordBatch,RecordBatch,VectorAccessible
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.drill.exec.record.AbstractRecordBatch
AbstractRecordBatch.BatchStateNested classes/interfaces inherited from interface org.apache.drill.exec.record.RecordBatch
RecordBatch.IterOutcome -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<ValueVector> protected List<FieldReference> protected List<BaseWriter.ComplexWriter> Deprecated.protected ProjectMemoryManagerprotected ResultSetLoaderFields inherited from class org.apache.drill.exec.record.AbstractSingleRecordBatch
incomingFields inherited from class org.apache.drill.exec.record.AbstractUnaryRecordBatch
callBackFields inherited from class org.apache.drill.exec.record.AbstractRecordBatch
batchStatsContext, container, context, oContext, popConfig, state, stats, unionTypeEnabledFields inherited from interface org.apache.drill.exec.record.RecordBatch
MAX_BATCH_ROW_COUNT -
Constructor Summary
ConstructorsConstructorDescriptionProjectRecordBatch(Project pop, RecordBatch incoming, FragmentContext context) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddLoader(ResultSetLoader loader) protected voidprotected RecordBatch.IterOutcomedoWork()voiddump()Perform dump of this batch's state to logs.protected RecordBatch.IterOutcomegetFinalOutcome(boolean hasMoreRecordInBoundary) Based on lastKnownOutcome and if there are more records to be output for current record boundary detected by EMIT outcome, this method returns EMIT or OK outcome.intGet the number of records.protected RecordBatch.IterOutcomeHandle Null input specially when Project operator is for query output.protected booleanMethods inherited from class org.apache.drill.exec.record.AbstractSingleRecordBatch
getIncomingMethods inherited from class org.apache.drill.exec.record.AbstractUnaryRecordBatch
getLastKnownOutcome, setLastKnownOutcomeMethods inherited from class org.apache.drill.exec.record.AbstractRecordBatch
buildSchema, cancel, checkContinue, close, getContainer, getContext, getPopConfig, getRecordBatchStatsContext, getSchema, getSelectionVector2, getSelectionVector4, getValueAccessorById, getValueVectorId, getWritableBatch, isRecordBatchStatsLoggingEnabled, iterator, next, next, next, schemaChangeException, schemaChangeExceptionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
allocationVectors
-
complexWriters
Deprecated. -
rsLoader
-
complexFieldReferencesList
-
memoryManager
-
-
Constructor Details
-
ProjectRecordBatch
-
-
Method Details
-
getRecordCount
public int getRecordCount()Description copied from interface:VectorAccessibleGet the number of records.- Returns:
- number of records
-
cancelIncoming
protected void cancelIncoming()- Overrides:
cancelIncomingin classAbstractUnaryRecordBatch<Project>
-
innerNext
- Overrides:
innerNextin classAbstractUnaryRecordBatch<Project>
-
getOutgoingContainer
- Specified by:
getOutgoingContainerin interfaceRecordBatch- Overrides:
getOutgoingContainerin classAbstractRecordBatch<Project>
-
doWork
- Specified by:
doWorkin classAbstractUnaryRecordBatch<Project>
-
addComplexWriter
-
addLoader
-
setupNewSchema
protected boolean setupNewSchema()- Specified by:
setupNewSchemain classAbstractUnaryRecordBatch<Project>
-
handleNullInput
Handle Null input specially when Project operator is for query output. This happens when the input returns no batches (returns a FASTNONEdirectly).Project operator has to return a batch with schema derived using the following 3 rules:
- Case 1: * ==> expand into an empty list of columns.
- Case 2: regular column reference ==> treat as nullable-int column
- Case 3: expressions => Call ExpressionTreeMaterialization over an empty vector contain. Once the expression is materialized without error, use the output type of materialized expression.
The batch is constructed with the above rules, and recordCount = 0. Returned with
OK_NEW_SCHEMAto down-stream operator.- Overrides:
handleNullInputin classAbstractUnaryRecordBatch<Project>- Returns:
- IterOutcome.NONE.
-
getFinalOutcome
Description copied from class:AbstractSingleRecordBatchBased on lastKnownOutcome and if there are more records to be output for current record boundary detected by EMIT outcome, this method returns EMIT or OK outcome.- Overrides:
getFinalOutcomein classAbstractSingleRecordBatch<Project>- Parameters:
hasMoreRecordInBoundary-- Returns:
- EMIT - If the lastknownOutcome was EMIT and output records corresponding to all the incoming records in current record boundary is already produced. OK - otherwise
-
dump
public void dump()Description copied from interface:RecordBatchPerform dump of this batch's state to logs.
-