Class ProjectRecordBatch
java.lang.Object
org.apache.drill.exec.record.AbstractRecordBatch<T>
org.apache.drill.exec.record.AbstractUnaryRecordBatch<T>
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.BatchState
Nested classes/interfaces inherited from interface org.apache.drill.exec.record.RecordBatch
RecordBatch.IterOutcome
-
Field Summary
Modifier and TypeFieldDescriptionprotected List<ValueVector>
protected List<FieldReference>
protected List<BaseWriter.ComplexWriter>
Deprecated.protected ProjectMemoryManager
protected ResultSetLoader
Fields inherited from class org.apache.drill.exec.record.AbstractSingleRecordBatch
incoming
Fields inherited from class org.apache.drill.exec.record.AbstractUnaryRecordBatch
callBack
Fields inherited from class org.apache.drill.exec.record.AbstractRecordBatch
batchStatsContext, container, context, oContext, popConfig, state, stats, unionTypeEnabled
Fields inherited from interface org.apache.drill.exec.record.RecordBatch
MAX_BATCH_ROW_COUNT
-
Constructor Summary
ConstructorDescriptionProjectRecordBatch
(Project pop, RecordBatch incoming, FragmentContext context) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addLoader
(ResultSetLoader loader) protected void
protected RecordBatch.IterOutcome
doWork()
void
dump()
Perform dump of this batch's state to logs.protected RecordBatch.IterOutcome
getFinalOutcome
(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.int
Get the number of records.protected RecordBatch.IterOutcome
Handle Null input specially when Project operator is for query output.protected boolean
Methods inherited from class org.apache.drill.exec.record.AbstractSingleRecordBatch
getIncoming
Methods inherited from class org.apache.drill.exec.record.AbstractUnaryRecordBatch
getLastKnownOutcome, setLastKnownOutcome
Methods 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, schemaChangeException
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:VectorAccessible
Get the number of records.- Returns:
- number of records
-
cancelIncoming
protected void cancelIncoming()- Overrides:
cancelIncoming
in classAbstractUnaryRecordBatch<Project>
-
innerNext
- Overrides:
innerNext
in classAbstractUnaryRecordBatch<Project>
-
getOutgoingContainer
- Specified by:
getOutgoingContainer
in interfaceRecordBatch
- Overrides:
getOutgoingContainer
in classAbstractRecordBatch<Project>
-
doWork
- Specified by:
doWork
in classAbstractUnaryRecordBatch<Project>
-
addComplexWriter
-
addLoader
-
setupNewSchema
protected boolean setupNewSchema()- Specified by:
setupNewSchema
in classAbstractUnaryRecordBatch<Project>
-
handleNullInput
Handle Null input specially when Project operator is for query output. This happens when the input returns no batches (returns a FASTNONE
directly).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_SCHEMA
to down-stream operator.- Overrides:
handleNullInput
in classAbstractUnaryRecordBatch<Project>
- Returns:
- IterOutcome.NONE.
-
getFinalOutcome
Description copied from class:AbstractSingleRecordBatch
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.- Overrides:
getFinalOutcome
in classAbstractSingleRecordBatch<Project>
- 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:RecordBatch
Perform dump of this batch's state to logs.
-